File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -181,17 +181,17 @@ void Accelerometer::accelerometerRead()
181
181
}
182
182
183
183
184
- if (priorXValue != xValue) {
185
- Gamepad1.xAxis (static_cast <int16_t >(xValue / localMax * 32767 ));
184
+ if (priorXValue != xValue) {
185
+ Gamepad1.xAxis (static_cast <int16_t >(static_cast < float >( xValue) / localMax * 32767 ));
186
186
priorXValue = xValue;
187
187
config.updateUSB = true ;
188
- }
188
+ }
189
189
190
- if (priorYValue != yValue) {
191
- Gamepad1.yAxis (static_cast <int16_t >(yValue / localMaxY * 32767 ));
190
+ if (priorYValue != yValue) {
191
+ Gamepad1.yAxis (static_cast <int16_t >(static_cast < float >( yValue) / localMaxY * 32767 ));
192
192
priorYValue = yValue;
193
193
config.updateUSB = true ;
194
- }
194
+ }
195
195
196
196
// Serial.print(F("DEBUG,AccelX:"));
197
197
// Serial.print(xValue);
You can’t perform that action at this time.
0 commit comments