wobblyhead hg > arduino > Joystick
comparison Joystick.cpp @ 5:328b2e0c7555
//debug
| author | ark |
|---|---|
| date | 2017-02-05 16:19 +0100 |
| parents | d423ea399401 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:a3fceeff4b21 | 5:328b2e0c7555 |
|---|---|
| 4 #include "WProgram.h" | 4 #include "WProgram.h" |
| 5 #endif | 5 #endif |
| 6 | 6 |
| 7 #include "Joystick.h" | 7 #include "Joystick.h" |
| 8 | 8 |
| 9 #define DEBUG | 9 //#define DEBUG |
| 10 | |
| 10 | 11 |
| 11 /** | 12 /** |
| 12 see Joystick.h for description. | 13 see Joystick.h for description. |
| 13 */ | 14 */ |
| 14 | 15 |
| 62 if(x.isStopped && y.isStopped) { | 63 if(x.isStopped && y.isStopped) { |
| 63 isCalibrated = true; | 64 isCalibrated = true; |
| 64 centerX = x.value; | 65 centerX = x.value; |
| 65 centerY = y.value; | 66 centerY = y.value; |
| 66 #ifdef DEBUG | 67 #ifdef DEBUG |
| 67 Serial.print(ms); | 68 Serial.print(ms); |
| 68 Serial.print(": Joystick calibrated, center="); | 69 Serial.print(": Joystick calibrated, center="); |
| 69 Serial.print(centerX); | 70 Serial.print(centerX); |
| 70 Serial.print(","); | 71 Serial.print(","); |
| 71 Serial.println(centerY); | 72 Serial.println(centerY); |
| 72 #endif | 73 #endif |
| 73 } | 74 } |
| 74 else return; | 75 else return; |
| 75 } | 76 } |
| 76 } | 77 } |
