Arduino IDE为以下代码提供错误
代码可以编译,但不能上传。 代码是:Arduino IDE为以下代码提供错误,arduino,ide,runtime-error,uploading,Arduino,Ide,Runtime Error,Uploading,代码可以编译,但不能上传。 代码是: int fsrPin = 0; // the FSR and 10K pulldown are connected to a0 int fsrReading; // the analog reading from the FSR resistor divider void setup(void) { Serial.begin(115200); } void loop(void) { fsrReading = analog
int fsrPin = 0; // the FSR and 10K pulldown are connected to a0
int fsrReading; // the analog reading from the FSR resistor divider
void setup(void) {
Serial.begin(115200);
}
void loop(void) {
fsrReading = analogRead(fsrPin);
Serial.print("Analog reading = ");
Serial.print(fsrReading); // print the raw analog reading
if (fsrReading < 10) {
Serial.println(" - No pressure");
} else if (fsrReading < 200) {
Serial.println(" - Light touch");
} else if (fsrReading < 500) {
Serial.println(" - Light squeeze");
} else if (fsrReading < 800) {
Serial.println(" - Medium squeeze");
} else {
Serial.println(" - Big squeeze");
}
delay(1000);
}
我已经检查了所有的端口和代码,一切似乎都很好,但是avr dude错误不断出现看起来USB电缆和Arduino的连接有些松动。您可以按照以下几个步骤进行计数:
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x41
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x41