This is an old revision of the document!
After you've made a directory for ptb1 on lab46, you can use the grabit command to acquire the source code that we'll be modifying in this project, like so:
grabit c4eng ptb1
This will populate the ptb1 directory with all source files that you'll need for this project.
The LED bar is a rather simplified version of putting 10 LEDs on your breadboard. The LED bar contains 10 different LEDs that require their own GPIO pins and resistors. Each gpio pin needs to be set to output mode. You can connect your resistors from one leg of the LED directly to the “-” column on the side of the bread-board to save some space. If your LED bar is not working, you can try flipping it around because the direction of the flow matters, just like regular LEDs.
each button should be wired the same way, just to different pins. each button needs a 3.3v ran through a 10Kohm resistor and a ground wire, with a final wire with a 10kohm resistor to a gpio pin. Within wiringpi, the pin must be set to input mode. The gpio wire should also be on the opposite side of the 3.3v wire and the ground wire. You made need to switch which pin your wires are connected to if your button is not working properly. You can also check if the button is working by looking at the gpio readall table before and after the button is being pressed, and you should see a change in voltage for that gpio pin (reminder to change voltage first gpio mode “pin” out, then gpio write “pin” 1).