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

/media/uploads/Kimbenn/20191209_091632.jpg

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

MbedSd Card
gndgnd
VoutVCC
p8CS
p5DI
p7SCK
p6DO

LCD Screen Wiring

MbedLCDexternal pwr
gndgndgnd
VDD5V
p8TX
p10RX
p11reset

Audio Driver Wiring

MbedAudioSpeaker
gndpwr - , in -
Voutpwr +
p#in+
out++
out --

Accelerometer Wiring

MbedIMU
gndgnd
Vout3.3V
p28SDA
p27SCL

Servo Wiring

MbedServoexternal Pwr
gndgnd (black)gnd
power( red)5V
p21PWM (yellow)

Other Mbed Wiring

MbedDevice
p18pushbutton down
p17pushbutton up
p26pushbutton next
p15photocell
p19potentiometer1
p20potentiometer2
p30LED1
p29LED2
p25LED3
p24LED4
p23LED5
p22LED6

LED Help!

Be sure to use appropriate resistors when connecting the Mbed to LEDs


Please log in to post comments.