Multi-game multiplayer arcade gaming system meant for the red X when playing Super Tic-Tac-Toe.
Dependencies: uLCD_4DGL_SE PinDetect SDFileSystem mbed wave_player
Diff: main.cpp
- Revision:
- 1:2a7e2f5aeda4
- Parent:
- 0:218d3fb75950
- Child:
- 2:d35fde2d82cd
--- a/main.cpp Thu Nov 26 02:58:17 2015 +0000 +++ b/main.cpp Sat Nov 28 21:57:03 2015 +0000 @@ -10,6 +10,7 @@ #include "Stage.h" #include "Pacman.h" #include "Ghost.h" +#include "RPSLK.h" /* -------------------------------------------------------------------------------------------- @@ -20,6 +21,10 @@ AnalogOut DACout(p18); wave_player waver(&DACout); +// XBee module +DigitalOut reset(p12); +Serial XBee(p13, p14); + // SD card SDFileSystem sd(p5, p6, p7, p8, "sd"); @@ -63,17 +68,13 @@ simon.playSimonSays(); // Play Super Tic-Tac-Toe } else if (game == 1) { - // Speaker - AnalogOut DACout(p18); - wave_player waver(&DACout); - - // RGB LED - RGBLED RGB(p25, p23, p22); - // Touch keypad InterruptIn input(p21); I2C i2c(p9, p10); Mpr121 MPR121(&i2c, Mpr121::ADD_VSS); + + // RGB LED + RGBLED RGB(p25, p23, p22); SuperTicTacToe super = SuperTicTacToe(input, MPR121, RGB, sd, uLCD, waver); super.playSuperTicTacToe(); @@ -141,9 +142,15 @@ // Game over display pacman.gameOver(); } else { - // PLAY RPSLK - wait(1); - uLCD.cls(); + // Tactile switch interrupts + PinDetect rock(p21); + PinDetect paper(p22); + PinDetect scissors(p23); + PinDetect lizard(p24); + PinDetect spock(p25); + + RPSLK rpslk = RPSLK(reset, rock, paper, scissors, lizard, spock, sd, XBee, uLCD, waver); + rpslk.playRPSLK(); } wait(3);