
Device: 16F628a
Circuit Decription: 2 Momentary Tacts, 2 LEDs.
"Go Button" and a "Mode Button"
"Main LED" and "Mode LED"
Code: Select all
;;Walkthrough;;
At power up go to Mode 1 state
Mode 1 state ;Solid Light
- Blink "Mode LED" 1x
- Turn off "Mode LED"
- if (Go) is pressed
o Light (Main LED) until it is depressed
- if (Mode) is pressed
o switch to (Mode 2 state)
Mode 2 state ;Slow Flash
- Blink "Mode LED" 2x, and leave it on
- if (Go) is pressed
o Light (Main LED) 1x per second, until it is depressed
- if (Mode) is pressed
o switch to (Mode 3 state)
Mode 3 state ;Medium Flash
- Blink "Mode LED" 3x, and leave it on
- if (Go) is pressed
o Light (Main LED) 2x per second, until it is depressed
- if (Mode) is pressed
o switch to (Mode 4 state)
Mode 4 state ;Fast Flash
- Blink "Mode LED" 4x, and leave it on
- if (Go) is pressed
o Light (Main LED) 3x per second, until it is depressed
- if (Mode) is pressed
o switch to (Mode 1 state)
