Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: USBDevice mbed-rtos mbed
Fork of JoyStick by
Diff: USBJoystick.h
- Revision:
- 2:ae7a31a3c618
- Parent:
- 0:33bc88c4ab31
- Child:
- 4:2cc58c173de8
--- a/USBJoystick.h Wed Aug 28 13:12:39 2013 +0000
+++ b/USBJoystick.h Fri Aug 30 01:37:49 2013 +0000
@@ -16,39 +16,8 @@
JOY_B1 = 2,
JOY_B2 = 4,
JOY_B3 = 8,
-};
-
-#if(0)
-enum JOY_HAT {
- JOY_HAT_UP = 0,
- JOY_HAT_RIGHT = 1,
- JOY_HAT_DOWN = 2,
- JOY_HAT_LEFT = 3,
- JOY_HAT_NEUTRAL = 4,
+ JOY_B4 = 16,
};
-#else
-enum JOY_HAT {
- JOY_HAT_UP = 0,
- JOY_HAT_UP_RIGHT = 1,
- JOY_HAT_RIGHT = 2,
- JOY_HAT_RIGHT_DOWN = 3,
- JOY_HAT_DOWN = 4,
- JOY_HAT_DOWN_LEFT = 5,
- JOY_HAT_LEFT = 6,
- JOY_HAT_LEFT_UP = 7,
- JOY_HAT_NEUTRAL = 8,
-};
-#endif
-
-/* X, Y and T limits */
-/* These values do not directly map to screen pixels */
-/* Zero may be interpreted as meaning 'no movement' */
-#define JX_MIN_ABS (-127) /*!< The maximum value that we can move to the left on the x-axis */
-#define JY_MIN_ABS (-127) /*!< The maximum value that we can move up on the y-axis */
-#define JT_MIN_ABS (-127) /*!< The minimum value for the throttle */
-#define JX_MAX_ABS (127) /*!< The maximum value that we can move to the right on the x-axis */
-#define JY_MAX_ABS (127) /*!< The maximum value that we can move down on the y-axis */
-#define JT_MAX_ABS (127) /*!< The maximum value for the throttle */
/**
*
@@ -136,10 +105,9 @@
* @param x x-axis position
* @param y y-axis position
* @param buttons buttons state
- * @param hat hat state 0 (up), 1 (right, 2 (down), 3 (left) or 4 (neutral)
* @returns true if there is no error, false otherwise
*/
- bool update(int16_t t, int16_t r, int16_t x, int16_t y, uint8_t buttons, uint8_t hat);
+ bool update(int16_t t, int16_t r, int16_t x, int16_t y, uint8_t buttons);
/**
* Write a state of the mouse
@@ -180,15 +148,7 @@
* @returns true if there is no error, false otherwise
*/
bool button(uint8_t button);
-
- /**
- * Press hat
- *
- * @param hat hat state
- * @returns true if there is no error, false otherwise
- */
- bool hat(uint8_t hat);
-
+
/*
* To define the report descriptor. Warning: this method has to store the length of the report descriptor in reportLength.
*
@@ -202,7 +162,6 @@
int16_t _x;
int16_t _y;
uint8_t _button;
- uint8_t _hat;
void _init();
};
