Introduction: Easy Arduino LED Dice
This instrcutable will show you how to hook up LEDs to show a face of a dice when a pushbutton is pressed.
Step 1: Supplies
For this project you will need to following:
11 long jumper wires
7 short jumper wires
1 Arduino Uno
1 USB cable for the Arduino
1 push button
Step 2: Start With Assembling Your LEDs
You will take your LEDs and place them in a H formation.
LED1: pins 1 and 2
LED2: pins 5 and 6
LED3: pins 9 and 10
LED4: pins 4 and 7
LED5: pins 3 and 4
LED6: 7 and 8
LED7: 11 and 12
Step 3: Start Wiring the LEDs
You will take your 7 short wires and start placing them on one side of the LED. One end of the wire will go in the negative channel on the board and the other on the same row as a LED leg. To connect the opposite side of the LEDs place a wire in the same row as a already connected wire and place it in the same row as the LED leg.
Step 4: Hook Up the Wires That Will Connect to the Arduino
Now you will take 8 of the 11 long wires and place them in your board on the other leg of the LED. Each LED needs one long wire and one short wire connected to it. Once the long wires are hooked up to the board you will place them in pins 1-7 on your Arduino.
LED1 in pin 1
LED2 in pin 2
LED3 in pin 3
and so forth
Once you have those 7 wires connected you will take the 8th wire and connect it to the ground on the pin side of the Arduino. One end of the wire will go in the negative channel that the short wires are plugged into and the other end in the Ground pin next to pin 13 on your Arduino.
Step 5: Hooking Up the Push Button
Take the resistor and place it into channel 21 and channel 27. In each channel place one end of the push button. Take one of the long wires and place it in channel 27 and connect it to the 3.3V pin on your Arduino. Take another long wire and place it from the positive channel to the Ground next to the 5V pin on your Arduino. In channel 21 place a long wire going from that channel to pin 8.
Step 6: Codes
Here is a code to test whether your LED connections are correctly connect. The LEDs should flash.
Step 7: Code Pt.2
Here is the code that makes the LEDs show a face of a dice when triggered by the push button.