Sunday, November 6, 2011

Toggling a LED

This is a better way of getting the classic LED toggling Blink program to turn the LED to to alternate state. I'd seen this elsewhere but forgot about it.It was recently suggested by David Beath, a student in our class.

boolean ledState = 0; //in the setup

digitalWrite(13,(ledState = !ledState)); // in the loop

No comments:

Post a Comment