This project was to create a binary number game. The red light blinks between one and fifteen times. Then switches (in this case highly economical bare wire contacts) are closed to match the number in binary. So for 5, the first and third switch would need to be closed. When the correct binary number has been entered, the green light blinks rapidly, then the process begins again.
The code for the binary game will be repurposed next week to build an analog glove that replaces the switches.
The big problem I encountered was initially failing to use voltage stabilizing capacitors. Once I lit up more than a single LED, the chip’s behavior became erratic. Adding the capacitors (pictured) immediately solved the problem. Guess that’s why everyone kept telling me to use ’em. But some things have to be learned independently.
Mostly this was an exercise in getting comfortable with the PIC Basic code. The code uses variables, conditionals and subroutines to get the job done. This should be very helpful for next week, when I repurpose it to work in analog.