Initial for Condor Simulator
Dependents: USBJoystick_2 USBJoystick_NEW
Fork of USBJoystick by
Diff: USBJoystick.h
- Revision:
- 5:fa0a30d0ef3d
- Parent:
- 4:71835900760f
- Child:
- 6:cefcdf03ca0e
--- a/USBJoystick.h Sat Sep 29 09:27:44 2018 +0000 +++ b/USBJoystick.h Sun Oct 07 14:37:43 2018 +0000 @@ -160,7 +160,7 @@ */ // USBJoystick(uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0100, uint16_t product_release = 0x0001, int waitForConnect = true): // 4 buttons, no padding on buttons // USBJoystick(uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0500, uint16_t product_release = 0x0001, int waitForConnect = true): // 8 buttons, no padding on buttons - USBJoystick(uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0604, uint16_t product_release = 0x0001, int waitForConnect = true): // 32 buttons, no padding on buttons + USBJoystick(uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0500, uint16_t product_release = 0x0005, int waitForConnect = true): // 32 buttons, no padding on buttons USBHID(0, 0, vendor_id, product_id, product_release, false) { _init(); connect(waitForConnect); @@ -179,7 +179,7 @@ * @param buttons buttons state * @returns true if there is no error, false otherwise */ - bool update(uint16_t x, uint16_t y, uint16_t b, uint16_t f, uint16_t r, uint16_t t, uint8_t hat, uint32_t buttons); + bool update(int16_t x, int16_t y, int16_t b, int16_t f, int16_t r, int16_t t, uint8_t hat, uint32_t buttons); /** * Write state of the joystick @@ -194,7 +194,7 @@ * @param t throttle position * @returns true if there is no error, false otherwise */ - bool throttle(uint16_t t); + bool throttle(int16_t t); /** * Move the rudder position @@ -202,7 +202,7 @@ * @param r rudder position * @returns true if there is no error, false otherwise */ - bool rudder(uint16_t r); + bool rudder(int16_t r); /** * Move the dive break position @@ -210,7 +210,7 @@ * @param b break position * @returns true if there is no error, false otherwise */ - bool diveBreak(uint16_t b); + bool diveBreak(int16_t b); /** * Move the flaps position @@ -218,7 +218,7 @@ * @param f flaps position * @returns true if there is no error, false otherwise */ - bool flaps(uint16_t f); + bool flaps(int16_t f); /** @@ -228,7 +228,7 @@ * @param y-axis position * @returns true if there is no error, false otherwise */ - bool move(uint16_t x, uint16_t y); + bool move(int16_t x, int16_t y); /** * Press one or several buttons @@ -254,12 +254,12 @@ virtual uint8_t * reportDesc(); private: - uint16_t _x; - uint16_t _y; - uint16_t _b; - uint16_t _f; - uint16_t _r; - uint16_t _t; + int16_t _x; + int16_t _y; + int16_t _b; + int16_t _f; + int16_t _r; + int16_t _t; uint8_t _hat; uint32_t _buttons;