Lab: First Arduino program

Get the code: _3_speed_blinking

Our first Arduino circuit consisted of a switch controlling two LEDs.  The default state was the red LED on and the yellow LED off.  Pressing the switch reversed this (yellow on, red off).

After getting this working, I decided to try something more complicated.  I programmed the LEDs to blink at three different rates and use the switch to change speeds, partially by adapting this Arduino blinking example for use with two LEDs at once.



Overall the setup works well, although there is a small bug in the program that is unnoticeable during normal use. Bonus points if you can find it.

No comments:

Post a Comment

Speak now...