# HG changeset patch # User ark # Date 1486245542 -3600 # Node ID a3fceeff4b211478887264474b01fb918bf3b532 # Parent d423ea39940132c588a4f47440d61cccf9803461 adjusted deadzone thresholds diff -r d423ea399401 -r a3fceeff4b21 Joystick.h --- a/Joystick.h Mon Jan 30 01:26:18 2017 +0100 +++ b/Joystick.h Sat Feb 04 22:59:02 2017 +0100 @@ -4,6 +4,23 @@ #include #include +/** + * center deadzone radius, if the joystick is not calibrated. + * raw pot value (0..1023) + */ +#define CENTER_DEADZONE_UNCALIBRATED 100 + +/** + * center deadzone radius, if the joystick is calibrated. + * raw pot value (0..1023) + */ +#define CENTER_DEADZONE_CALIBRATED 15 + +/** + * center radius, for digital interpretation. logical (-100..100) value + */ +#define CENTER_RADIUS_DIGITAL 20 + /** utility class for interpreting joystick values. @@ -40,26 +57,6 @@ // calibrated center of y axis int centerY; - /** - * center deadzone radius, if the joystick is not calibrated. - * - * positions within this distance from the center are considered in the - * center. - */ - const int CENTER_DEADZONE_UNCALIBRATED = 50; - - /** - * center deadzone radius, if the joystick is calibrated. - * positions within this distance from the center are considered in the - * center. - */ - const int CENTER_DEADZONE_CALIBRATED = 5; - - /** - * center radius, for digital interpretation. - */ - const int CENTER_RADIUS_DIGITAL = 20; - /** create an uninitialised Joystick. setup() must be called after this to make it usable.