comparison Joystick.h @ 1:fd012dcc048d

added isCentered, dvx, dvy
author ark
date 2017-01-29 13:59 +0100
parents f31cf3175189
children 395297edda26
comparison
equal deleted inserted replaced
0:f31cf3175189 1:fd012dcc048d
23 23
24 // if calibrated, current vector, x component 24 // if calibrated, current vector, x component
25 float vx; 25 float vx;
26 // if calibrated, current vector, y component 26 // if calibrated, current vector, y component
27 float vy; 27 float vy;
28 // flag, if true joystick is considered centered/idle
29 bool isCentered;
30 // "digital" vector, x
31 int dvx;
32 // "digital" vector, y
33 int dvy;
28 34
29 // flag, if true joystick is calibrated. 35 // flag, if true joystick is calibrated.
30 bool isCalibrated; 36 bool isCalibrated;
31 37
32 // calibrated center of x axis 38 // calibrated center of x axis
33 int centerX; 39 int centerX;
34 // calibrated center of y axis 40 // calibrated center of y axis
35 int centerY; 41 int centerY;
36 42
37 /** center deadzone radius. if the joystick is not calibrated, 43 /**
44 * center deadzone radius, if the joystick is not calibrated.
45 *
38 * positions within this distance from the center are considered in the 46 * positions within this distance from the center are considered in the
39 * center. 47 * center.
40 */ 48 */
41 const int CENTER_DEADZONE = 50; 49 const int CENTER_DEADZONE_UNCALIBRATED = 50;
42 50
51 /**
52 * center deadzone radius, if the joystick is calibrated.
53 * positions within this distance from the center are considered in the
54 * center.
55 */
56 const int CENTER_DEADZONE_CALIBRATED = 5;
57
58 /**
59 * center radius, for digital interpretation.
60 */
61 const int CENTER_RADIUS_DIGITAL = 100;
62
43 /** 63 /**
44 create an uninitialised Joystick. 64 create an uninitialised Joystick.
45 setup() must be called after this to make it usable. 65 setup() must be called after this to make it usable.
46 */ 66 */
47 Joystick(); 67 Joystick();