Dice of Destiny
Overview
Dice of Destiny is an Mbed based dice rolling game. The objective of the game is to guess the correct dice roll that is generated by the program. User will have to input a guess of what they think a dice will roll (between 1 to 6) by using pushbuttons to light up that number of LED’s. Dice color and eye size can be adjusted by potentiometer. The user will roll “dice” with an accelerometer and the LCD screen will display a digital picture of the dice they rolled. If the user guessed right, a hand will be lifted by a servo to highfive the user and a victory sound will be played. If user guessed wrong, a losing sound will be played.
Program Code
Import programDiceOfDestiny
Dice of Destiny game for 4180 Final Project
Photos

Demo Video
Parts List
- Mbed
- uLCD
- SD Card Reader
- Audio Driver
- Speaker
- Accelerometer
- Servo Motor
- Photocell w/ 10k resistor
- 6 LEDs and appropriate resistors
- 3 Pushbuttons
- 2 Potentiometers
- External 5V Power Supply
- Cardboard Hand
- Wires
- Tape
Wiring
SD Card Reader Wiring
| Mbed | Sd Card |
|---|---|
| gnd | gnd |
| Vout | VCC |
| p8 | CS |
| p5 | DI |
| p7 | SCK |
| p6 | DO |
LCD Screen Wiring
| Mbed | LCD | external pwr |
|---|---|---|
| gnd | gnd | gnd |
| VDD | 5V | |
| p8 | TX | |
| p10 | RX | |
| p11 | reset |
Audio Driver Wiring
| Mbed | Audio | Speaker |
|---|---|---|
| gnd | pwr - , in - | |
| Vout | pwr + | |
| p# | in+ | |
| out+ | + | |
| out - | - |
Accelerometer Wiring
| Mbed | IMU |
|---|---|
| gnd | gnd |
| Vout | 3.3V |
| p28 | SDA |
| p27 | SCL |
Servo Wiring
| Mbed | Servo | external Pwr |
|---|---|---|
| gnd | gnd (black) | gnd |
| power( red) | 5V | |
| p21 | PWM (yellow) |
Other Mbed Wiring
| Mbed | Device |
|---|---|
| p18 | pushbutton down |
| p17 | pushbutton up |
| p26 | pushbutton next |
| p15 | photocell |
| p19 | potentiometer1 |
| p20 | potentiometer2 |
| p30 | LED1 |
| p29 | LED2 |
| p25 | LED3 |
| p24 | LED4 |
| p23 | LED5 |
| p22 | LED6 |
LED Help!
Be sure to use appropriate resistors when connecting the Mbed to LEDs
Please log in to post comments.
