Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arduino stuck in an infinite loop

Tags:

arduino

My Arduino is stuck in an infinite loop trying to read from a pin and print it to the serial console. I can't upload any other programs now. What can I do to get the chip out of the loop?

like image 992
mbreedlove Avatar asked Mar 12 '11 23:03

mbreedlove


People also ask

How do you stop an infinite loop in Arduino?

Methods to Stop void loop in ArduinoUsing Infinite While Loop. Using the Sleep Library. Using Exit(0) statement. Using If Statement.

Can you break out of Arduino loop?

break is used to exit from a for , while or do… ​while loop, bypassing the normal loop condition. It is also used to exit from a switch case statement.

What is an infinite loop in Arduino?

A while loop will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor.


1 Answers

Remove the USB connection, close the IDE, open the IDE, open BareMinimum, hold the reset button, plugin the USB connection, click the upload button 1/2 a second after removing your finger from the reset button.

like image 133
Colton Avatar answered Sep 28 '22 11:09

Colton