int left=A0;int right=A1;int leftPot=0;int rightPot=0;void setup() { Serial.begin(9600);}void loop() { rightPot=analogRead(right); leftPot=analogRead(left); if(rightPot》=28||leftPot》=28) { Serial.print(“A0=”); Serial.print(leftPot); Serial.print(“xA1=”); Serial.print(rightPot); Serial.println(“x”); } delay(100);} Arduino 代码
int left=A0;int right=A1;int leftPot=0;int rightPot=0;void setup() { Serial.begin(9600);}void loop() { rightPot=analogRead(right); leftPot=analogRead(left); if(rightPot》=28||leftPot》=28) { Serial.print(“A0=”); Serial.print(leftPot); Serial.print(“xA1=”); Serial.print(rightPot); Serial.println(“x”); } delay(100);} Arduino 代码
举报