I wanted to test the “syntheseizer” I built (one potentiometer with two piezosummers playing same tone, as set by the potentiometer, in different octaves). And of course some blinking leds.
I spent 30 minutes figuring out why it didn’t work. Seemed to work nice in the Searduino Simulator (wait a week until it’s ready for use). Tons of time checking that the libraries built are ok. Finally, I tested to upload some code from the Arduino examples and, all of a sudden, reading analog pin worked again… and guess what? After a long while I found this:
#define analogRead(p) 500
Kinda explains why all the delays based on digitalRead I did always took 1/2 a second. It’s hard to love your self after such a mistake. And yes, this really addresses an issue with C.
What you see is NOT what you compile.