sqefqsdf
Dependencies: C12832 EthernetInterface LM75B mbed-rtos mbed
Fork of app-board-LM75B by
Diff: Joystick.h
- Revision:
- 6:77a4c45f6416
diff -r 608f2bf4d3f7 -r 77a4c45f6416 Joystick.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Joystick.h Thu Mar 23 12:51:27 2017 +0000 @@ -0,0 +1,55 @@ +#ifndef Joystick_H +#define Joystick_H + +#include "mbed.h" +//Class to control an RGB LED using three PWM pins +class Joystick +{ + +public: + + /** + * Represents the possible directions of the joystick + */ + enum Direction { + UP, + DOWN, + LEFT, + RIGHT, + MIDDLE, + NONE + }; + + /** Creates an object of a joystick which can be used to control + * + * @param up + * @param down + * @param right + * @param right + * @param middle + * @returns the average temperature in °C + */ + Joystick(PinName up, PinName down, PinName left, PinName right, PinName middle); + + /** + * The destructor of the Joystick destroying all the DigitalIn objects + */ + ~Joystick(); + + /** + * Gets the direction the joystick is pressed + * + * @return the direction of the joystick + */ + Direction getDirection(); + +private: + DigitalIn * up; + DigitalIn * down; + DigitalIn * left; + DigitalIn * right; + DigitalIn * middle; + Direction direction; +}; + +#endif \ No newline at end of file