Dice of Destiny game for 4180 Final Project
Dependencies: mbed wave_player Servo mbed-rtos 4DGL-uLCD-SE SDFileSystem_OldbutworkswithRTOS PinDetect MMA8452
Diff: main.cpp
- Revision:
- 11:f10e4bf76994
- Parent:
- 10:5b1f8be6c4f3
--- a/main.cpp Mon Dec 09 03:56:43 2019 +0000 +++ b/main.cpp Mon Dec 09 14:25:02 2019 +0000 @@ -126,9 +126,9 @@ } void dice2(){ lcd_mutex.lock(); - uLCD.filled_rectangle(20, 20, 108, 108, dice_color); - uLCD.filled_circle(88,40,dot_size,BLACK); - uLCD.filled_circle(40,88,dot_size,BLACK); + uLCD.filled_rectangle(17, 17, 111, 111, dice_color); + uLCD.filled_circle(92,36,dot_size,BLACK); + uLCD.filled_circle(36,92,dot_size,BLACK); Thread::wait(1000); uLCD.cls(); lcd_mutex.unlock(); @@ -136,10 +136,11 @@ } void dice3(){ lcd_mutex.lock(); - uLCD.filled_rectangle(20, 20, 108, 108, dice_color); + + uLCD.filled_rectangle(17, 17, 111, 111, dice_color); uLCD.filled_circle(64,64,dot_size,BLACK); - uLCD.filled_circle(88,40,dot_size,BLACK); - uLCD.filled_circle(40,88,dot_size,BLACK); + uLCD.filled_circle(92,36,dot_size,BLACK); + uLCD.filled_circle(36,92,dot_size,BLACK); Thread::wait(1000); uLCD.cls(); lcd_mutex.unlock(); @@ -147,11 +148,12 @@ } void dice4(){ lcd_mutex.lock(); - uLCD.filled_rectangle(20, 20, 108, 108, dice_color); - uLCD.filled_circle(88,40,dot_size,BLACK); - uLCD.filled_circle(40,88,dot_size,BLACK); - uLCD.filled_circle(40,40,dot_size,BLACK); - uLCD.filled_circle(88,88,dot_size,BLACK); + + uLCD.filled_rectangle(17, 17, 111, 111, dice_color); + uLCD.filled_circle(92,36,dot_size,BLACK); + uLCD.filled_circle(36,92,dot_size,BLACK); + uLCD.filled_circle(36,36,dot_size,BLACK); + uLCD.filled_circle(92,92,dot_size,BLACK); Thread::wait(1000); uLCD.cls(); lcd_mutex.unlock(); @@ -159,12 +161,13 @@ } void dice5(){ lcd_mutex.lock(); - uLCD.filled_rectangle(20, 20, 108, 108, dice_color); + + uLCD.filled_rectangle(17, 17, 111, 111, dice_color); uLCD.filled_circle(64,64,dot_size,BLACK); - uLCD.filled_circle(88,40,dot_size,BLACK); - uLCD.filled_circle(40,88,dot_size,BLACK); - uLCD.filled_circle(40,40,dot_size,BLACK); - uLCD.filled_circle(88,88,dot_size,BLACK); + uLCD.filled_circle(92,36,dot_size,BLACK); + uLCD.filled_circle(36,92,dot_size,BLACK); + uLCD.filled_circle(36,36,dot_size,BLACK); + uLCD.filled_circle(92,92,dot_size,BLACK); Thread::wait(1000); uLCD.cls(); lcd_mutex.unlock(); @@ -172,13 +175,13 @@ } void dice6(){ lcd_mutex.lock(); - uLCD.filled_rectangle(20, 20, 108, 108, dice_color); - uLCD.filled_circle(88,40,dot_size,BLACK); - uLCD.filled_circle(40,88,dot_size,BLACK); - uLCD.filled_circle(40,40,dot_size,BLACK); - uLCD.filled_circle(88,88,dot_size,BLACK); - uLCD.filled_circle(40,40,dot_size,BLACK);//Not finished yet - uLCD.filled_circle(88,88,dot_size,BLACK); + uLCD.filled_rectangle(17, 17, 111, 111, dice_color); + uLCD.filled_circle(92,36,dot_size,BLACK); + uLCD.filled_circle(36,92,dot_size,BLACK); + uLCD.filled_circle(36,36,dot_size,BLACK); + uLCD.filled_circle(92,92,dot_size,BLACK); + uLCD.filled_circle(36,64,dot_size,BLACK);//Not finished yet + uLCD.filled_circle(92,64,dot_size,BLACK); Thread::wait(1000); uLCD.cls(); lcd_mutex.unlock(); @@ -191,11 +194,11 @@ if (game_state == 1){ lcd_mutex.lock(); uLCD.printf("Input your guess\nof the dice roll\nwith the buttons\non the breadbaord.\n\n"); - Thread::wait(300); + //Thread::wait(3000); uLCD.printf("Pick a number 1-6\nthen roll the die.\n\n"); - Thread::wait(200); + //Thread::wait(2000); uLCD.printf("If you want to\nchange the dot\nsize or color,\nyou can with the\npots."); - Thread::wait(600); + Thread::wait(6000); uLCD.cls(); lcd_mutex.unlock(); player_guess = 1; @@ -349,7 +352,7 @@ Thread t2(input_guess_change_settings); Thread t3(view_result_high_five); - + uLCD.baudrate(3000000); while(1){ if (game_state == 0){ myservo = 0;