Data Sheet
Project 14
Button Stoplight
Build this circuit. Load sketch Button_Stoplight into Snapino
TM
using the programming instructions in project 3. The red LED (D1)
should be on; push the press switch (S2) to change which LED is
on, order is red-yellow-green like a stoplight.
Programming Note: This sketch uses a
counter to switch between different LEDs.
When the button is pressed, it increases the
counter by 1. Each LED is activated when the
counter reaches a certain number. When the
counter reaches 4 it is reset to back 1.
-24-
SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 25










