Recently I started using my Uno R2 as I got my teacher to start using the arduino platform in my digital electronics class. All went well for a long time and i was making programs and having fun but recently after uploading this code...
long readTemp() {
long result;
// Read temperature sensor against 1.1V reference
ADMUX = _BV(REFS1) | _BV(REFS0) | _BV(MUX3);
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
result = (result - 125) * 1075;
return result;
}
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println( readTemp(), DEC );
delay(1000);
}
I get this error every time i try to upload a new sketch to the R2
"avrdude: stk500_getsync(): not in sync: resp=0x00"
The program above is working and is communication over serial properly. I have tried to burn the boot loader but i get the same result. I have also tried pressing the reset before uploading. I do notice also the Arduino does reset when it starts to upload and tries to communicate over serial as the RX and pin 13 led blink before the error appears. I have tried this on 4 separate computers all running windows 7 x64 and it had previously worked on the computers until that last program was uploaded. I have used this code before with out having this problem. Any help would be great thanks.
Also note after attempting to upload it resumes the code from above.