changeset 4:a3fceeff4b21

adjusted deadzone thresholds
author ark
date 2017-02-04 22:59 +0100
parents d423ea399401
children 328b2e0c7555
files Joystick.h
diffstat 1 files changed, 17 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- 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 <Potentiometer.h>
 #include <Button.h>
 
+/** 
+ * 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.