Arduino LED Dice Improved Version

by kYLe yAnG in Circuits > Computers

96 Views, 0 Favorites, 0 Comments

Arduino LED Dice Improved Version

S__13418515.jpg

When playing board games, there may not necessarily have enough space to roll dice, and some games requires to roll dice twice, so this LED device can replace dice and adapt different game rules. If you push the first button of the device, it will "roll once; if you push the second button of the device, it will "roll" twice.

Supplies

Arduino*1

LED*7

Resistor(1/4W, 100Ω)*7

Resistor(1/4W, 10kΩ)*2

wire*10

pin header connector*1

button*2

breadboard*1

Assembling the Circuit

SharedScreenshot.jpg
S__13418517.jpg

The picture shows the connection between LEDs. I did not put the cathode connection and resistor, please remember to connect them to the breadboard. For the buttons, use the pin header connector to connect to the anode and connect the cathode and Resistor(1/4W, 10kΩ).

Coding

SharedScreenshot.jpg

Copy the code, paste it on Arduino software, and click the "Upload" button.

Code:https://create.arduino.cc/editor/ifgyreig/ac7d92b6-3d71-411b-8916-1ea5cadde9c3/preview

Test

Push the buttons and see if it works.