Hi
I am unable to upload to my Arduino Micro anymore, it compiles the sketch and then just hangs on "Uploading..."
Then after few minutes i get an error (Please check attachment for error).
It worked until i uploaded this sketch :
void setup()
{
// initialize serial communication with computer:
Serial.begin(9600);
// initialize all the readings to 0:
}
void loop() {
SmoothSensorReading(0,10);
SmoothSensorReading(1,10);
Serial.println("Restarting while...");
// delay(500); // delay in between reads for stability
}
void SmoothSensorReading(int pinNr, int Samples) {
float readings[Samples]; // the readings from the analog input
int index = 0; // the index of the current reading
float total = 0; // the running total
float average = 0; // the average
for (int thisReading = 0; thisReading < Samples; thisReading++)
readings[thisReading] = 0;
do
{
// subtract the last reading:
total= total - readings[index];
// read from the sensor:
readings[index] = (5.0 * analogRead(pinNr) * 100.0) / 1024;
// add the reading to the total:
total= total + readings[index];
// advance to the next position in the array:
index = index + 1;
// if we're at the end of the array...
if (index >= Samples) {
average = total / Samples;
// send it to the computer as ASCII digits
Serial.print("Average for pin : ");
Serial.print(pinNr);
Serial.print(" = ");
Serial.println(average);
}
} while (index < Samples);
}
I have attempted the following :
- Reset the device with the button
- Opened up baudrate 1200 and closed it which cause the device also to reset.
- Removed the device from device manager and reinstalled it.
When i reset the device the correct behavior is seen.
First the bootloaded shows up port 14, then it dissapears and the micro shows up port 13.
When i open up the dev environment and go to Serial Monitor i can see the last program i uploaded (code above ^^) running.
I have attempted to load the Blink sample under the basics menu.
I have also read the troubleshooting page but this didnt help me.
I have attached the error from the IDE.
I had Arduino IDE version 1.5.5 now i installed 1.5.6-r2 this did not fix my problem.
The error persists.
When i press upload the RX led blinks approx 5-6 times then nothing
The TX does not blink.
I have just attached another board i have Mega 2560 and i could upload without problems the blink sample.
So i think a communication error on the PC end is excluded from being the source of the problem?