[AO 미동작]

- 코드 단순화를 위한 AO 로직 업데이트했으나, 작동안함
  ㄴ 코드 변경 전 커밋
- Labview Library 작성
main
Changwoo Park 1 year ago
parent 77e0c4bb75
commit 1ef1e47cc1

@ -1,4 +1,4 @@
String AO_setup(int i, int Rng) { void AO_setup(int i, int Rng) {
DFRobot_GP8403 AO; DFRobot_GP8403 AO;
bool needBegin = true; bool needBegin = true;
@ -38,9 +38,9 @@ String AO_setup(int i, int Rng) {
} }
if(needBegin){ // If not begin yet if(needBegin){ // If not begin yet
Serial.println("AO_0 init begin"); Serial.println("AO init begin");
while(AO.begin()!=0); while(AO.begin()!=0);
Serial.println("AO_0 init succeed"); Serial.println("AO init succeed");
AO.setDACOutVoltage(0, 0); AO.setDACOutVoltage(0, 0);
AO.setDACOutVoltage(0, 1); AO.setDACOutVoltage(0, 1);
delay(20); delay(20);
@ -54,9 +54,10 @@ String AO_setup(int i, int Rng) {
} }
} }
RngAO[i] = Rng; RngAO[i] = Rng;
Serial.println("AO FIN");
} }
String AO_Write(int i, int volt) { void AO_Write(int i, int volt) {
DFRobot_GP8403 AO; DFRobot_GP8403 AO;
int ch; int ch;

@ -63,7 +63,7 @@ DFRobot_GP8403 AO_10(&Wire,0x5D);
DFRobot_GP8403 AO_12(&Wire,0x5E); DFRobot_GP8403 AO_12(&Wire,0x5E);
DFRobot_GP8403 AO_14(&Wire,0x5F); DFRobot_GP8403 AO_14(&Wire,0x5F);
int voltOffset = 185; int voltOffset = 0;//185;
int RngAO[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int RngAO[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// ========== ========== Processing // ========== ========== Processing

@ -201,4 +201,15 @@ String Prcss_RngAO(unsigned int data[], int dataSize){
} }
str += RcvOK; str += RcvOK;
return str + FIN; return str + FIN;
}
String Prcss_ChMC9(unsigned int data[], int dataSize){
String str = "ChMC9!:";
int d = 2;
for(int i=0 ; i<dataSize ; i++){
AO_setup(i, data[i]);
delay(d);
}
str += RcvOK;
return str + FIN;
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save