Gregory Boudreau / Mbed 2 deprecated Lab6_2036_turkey_greg

Dependencies:   4DGL-uLCD-SE PinDetect mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers joystick.h Source File

joystick.h

00001 #ifndef JOYSTICK_H
00002 #define JOYSTICK_H
00003 
00004 #include "mbed.h"
00005 
00006 class Nav_Switch
00007 {
00008 public:
00009     Nav_Switch(PinName up,PinName down,PinName left,PinName right,PinName fire);
00010     int read();
00011 //boolean functions to test each switch
00012     bool up();
00013     bool down();
00014     bool left();
00015     bool right();
00016     bool fire();
00017 //automatic read on RHS
00018     operator int ();
00019 //index to any switch array style
00020    bool operator[](int index) {
00021       return _pins[index];
00022    };
00023 private:
00024     BusIn _pins;
00025 };
00026 
00027 
00028 
00029 #endif