A note hitting game for the mbed LPC 1768. User uses a joystick to hit notes as they come down the screen in 3 different lanes.

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player

Committer:
jmpin
Date:
Thu Mar 17 21:12:59 2016 +0000
Revision:
1:94b1ec213686
Game is pretty much finished, minus the sound coming from .wav files from the SD card

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jmpin 1:94b1ec213686 1 #include "mbed.h"
jmpin 1:94b1ec213686 2 #include "Nav_Switch.h"
jmpin 1:94b1ec213686 3
jmpin 1:94b1ec213686 4
jmpin 1:94b1ec213686 5 Nav_Switch::Nav_Switch (PinName up,PinName down,PinName left,PinName right,PinName fire):
jmpin 1:94b1ec213686 6 _pins(up, down, left, right, fire)
jmpin 1:94b1ec213686 7 {
jmpin 1:94b1ec213686 8 _pins.mode(PullUp); //needed if pullups not on board or a bare nav switch is used - delete otherwise
jmpin 1:94b1ec213686 9 wait(0.001); //delays just a bit for pullups to pull inputs high
jmpin 1:94b1ec213686 10 }
jmpin 1:94b1ec213686 11 inline bool Nav_Switch::up()
jmpin 1:94b1ec213686 12 {
jmpin 1:94b1ec213686 13 return !(_pins[0]);
jmpin 1:94b1ec213686 14 }
jmpin 1:94b1ec213686 15 inline bool Nav_Switch::down()
jmpin 1:94b1ec213686 16 {
jmpin 1:94b1ec213686 17 return !(_pins[1]);
jmpin 1:94b1ec213686 18 }
jmpin 1:94b1ec213686 19 inline bool Nav_Switch::left()
jmpin 1:94b1ec213686 20 {
jmpin 1:94b1ec213686 21 return !(_pins[2]);
jmpin 1:94b1ec213686 22 }
jmpin 1:94b1ec213686 23 inline bool Nav_Switch::right()
jmpin 1:94b1ec213686 24 {
jmpin 1:94b1ec213686 25 return !(_pins[3]);
jmpin 1:94b1ec213686 26 }
jmpin 1:94b1ec213686 27 bool Nav_Switch::fire()
jmpin 1:94b1ec213686 28 {
jmpin 1:94b1ec213686 29 return !(_pins[4]);
jmpin 1:94b1ec213686 30 }
jmpin 1:94b1ec213686 31 int Nav_Switch::read()
jmpin 1:94b1ec213686 32 {
jmpin 1:94b1ec213686 33 return _pins.read();
jmpin 1:94b1ec213686 34 }
jmpin 1:94b1ec213686 35 Nav_Switch::operator int()
jmpin 1:94b1ec213686 36 {
jmpin 1:94b1ec213686 37 return _pins.read();
jmpin 1:94b1ec213686 38 }