diff --git a/PS3Enums.h b/PS3Enums.h index dca5bebe..7ee84293 100644 --- a/PS3Enums.h +++ b/PS3Enums.h @@ -56,8 +56,7 @@ const uint8_t PS3_LEDS[] PROGMEM = { }; /** - * Buttons on the controllers - * + * Buttons on the controllers. * Note: that the location is shifted 9 when it's connected via USB. */ const uint32_t PS3_BUTTONS[] PROGMEM = { @@ -87,8 +86,7 @@ const uint32_t PS3_BUTTONS[] PROGMEM = { }; /** - * Analog buttons on the controllers - * + * Analog buttons on the controllers. * Note: that the location is shifted 9 when it's connected via USB. */ const uint8_t PS3_ANALOG_BUTTONS[] PROGMEM = { @@ -134,46 +132,6 @@ enum ColorsEnum { Off = 0x00, }; -/** - * Sensors inside the Sixaxis Dualshock 3 and Move controller. - * - * Note: that the location is shifted 9 when it's connected via USB. - */ -enum SensorEnum { - /** Accelerometer x-axis */ - aX = 50, - /** Accelerometer y-axis */ - aY = 52, - /** Accelerometer z-axis */ - aZ = 54, - /** Gyro z-axis */ - gZ = 56, - - /** Accelerometer x-axis */ - aXmove = 28, - /** Accelerometer z-axis */ - aZmove = 30, - /** Accelerometer y-axis */ - aYmove = 32, - - /** Gyro x-axis */ - gXmove = 40, - /** Gyro z-axis */ - gZmove = 42, - /** Gyro y-axis */ - gYmove = 44, - - /** Temperature sensor */ - tempMove = 46, - - /** Magnetometer x-axis */ - mXmove = 47, - /** Magnetometer z-axis */ - mZmove = 49, - /** Magnetometer y-axis */ - mYmove = 50, -}; - enum StatusEnum { // Note that the location is shifted 9 when it's connected via USB // Byte location | bit location diff --git a/PS4Parser.h b/PS4Parser.h index 738cf89b..d3e28f88 100644 --- a/PS4Parser.h +++ b/PS4Parser.h @@ -121,11 +121,6 @@ enum DPADEnum { DPAD_OFF = 0x8, }; -enum PS4SensorEnum { - gX, gY, gZ, /** Gyro values */ - aX, aY, aZ, /** Accelerometer values */ -}; - /** This class parses all the data sent by the PS4 controller */ class PS4Parser { public: @@ -191,8 +186,8 @@ public: return (atan2(ps4Data.accX, ps4Data.accZ) + PI) * RAD_TO_DEG; }; - int16_t getSensor(PS4SensorEnum a) { - switch(a) { + int16_t getSensor(SensorEnum s) { + switch(s) { case gX: return ps4Data.gyroX; case gY: diff --git a/controllerEnums.h b/controllerEnums.h index 155588f2..0eae781d 100644 --- a/controllerEnums.h +++ b/controllerEnums.h @@ -18,9 +18,9 @@ #ifndef _controllerenums_h #define _controllerenums_h -/* - This header file is used to store different enums for the controllers, - This is necessary so all the different libraries can be used at once +/** + * This header file is used to store different enums for the controllers, + * This is necessary so all the different libraries can be used at once. */ /** Enum used to turn on the LEDs on the different controllers. */ @@ -124,6 +124,42 @@ enum AnalogHatEnum { RightHatY = 3, }; +/** + * Sensors inside the Sixaxis Dualshock 3, Move controller and PS4 controller. + * Note: that the location is shifted 9 when it's connected via USB on the PS3 controller. + */ +enum SensorEnum { + /** Accelerometer values */ + aX = 50, aY = 52, aZ = 54, + /** Gyro z-axis */ + gZ = 56, + gX, gY, // These are not available on the PS3 controller + + /** Accelerometer x-axis */ + aXmove = 28, + /** Accelerometer z-axis */ + aZmove = 30, + /** Accelerometer y-axis */ + aYmove = 32, + + /** Gyro x-axis */ + gXmove = 40, + /** Gyro z-axis */ + gZmove = 42, + /** Gyro y-axis */ + gYmove = 44, + + /** Temperature sensor */ + tempMove = 46, + + /** Magnetometer x-axis */ + mXmove = 47, + /** Magnetometer z-axis */ + mZmove = 49, + /** Magnetometer y-axis */ + mYmove = 50, +}; + /** Used to get the angle calculated using the PS3 controller and PS4 controller. */ enum AngleEnum { Pitch = 0x01,