Stop The loop() Insanity!

The simplest Arduino program looks like this:

This does nothing beyond build and run.

The setup() function is used for one time, well, setup. This is where you initialize a sensor or connect to Wifi or set the speed of your serial port.

The loop() function is where you do the work. This is intended for repetitive tasks, like reading from a sensor or uploading some information or blinking lights. More