We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b84955b commit 4d0e7b2Copy full SHA for 4d0e7b2
Accelerometer.cpp
@@ -181,17 +181,17 @@ void Accelerometer::accelerometerRead()
181
}
182
183
184
- if (priorXValue != xValue) {
185
- Gamepad1.xAxis(static_cast<int16_t>(xValue / localMax * 32767));
+if (priorXValue != xValue) {
+ Gamepad1.xAxis(static_cast<int16_t>(static_cast<float>(xValue) / localMax * 32767));
186
priorXValue = xValue;
187
config.updateUSB = true;
188
- }
+}
189
190
- if (priorYValue != yValue) {
191
- Gamepad1.yAxis(static_cast<int16_t>(yValue / localMaxY * 32767));
+if (priorYValue != yValue) {
+ Gamepad1.yAxis(static_cast<int16_t>(static_cast<float>(yValue) / localMaxY * 32767));
192
priorYValue = yValue;
193
194
195
196
// Serial.print(F("DEBUG,AccelX:"));
197
// Serial.print(xValue);
0 commit comments