An implementation of "BrickBreaker" for the mbed platform using the uLCD-4DGL display and a 5-Way joystick
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player
Diff: Nav_Switch.h
- Revision:
- 0:c9df12bcc92d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Nav_Switch.h Mon Oct 31 15:08:43 2016 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +class Nav_Switch +{ +public: + Nav_Switch(PinName up,PinName down,PinName left,PinName right,PinName fire); + int read(); +//boolean functions to test each switch + bool up(); + bool down(); + bool left(); + bool right(); + bool fire(); +//automatic read on RHS + operator int (); +//index to any switch array style + bool operator[](int index) { + return _pins[index]; + }; +private: + BusIn _pins; + +}; \ No newline at end of file