Skip to content

Commit

Permalink
pybricks.hubs.MoveHub: Increase resolution for imu.acceleration()
Browse files Browse the repository at this point in the history
  • Loading branch information
cschlack committed Jan 12, 2022
1 parent ac9ae86 commit 116eb6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pybricks/hubs/pb_type_movehub.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ STATIC mp_obj_t hubs_MoveHub_IMU_acceleration(mp_obj_t self_in) {
// Convert to appropriate units and return as tuple
mp_obj_t values[3];
for (uint8_t i = 0; i < 3; i++) {
values[i] = MP_OBJ_NEW_SMALL_INT((data[i] * 10) >> 6);
values[i] = MP_OBJ_NEW_SMALL_INT(((data[i] + 1) * 11) >> 3);
}
return mp_obj_new_tuple(3, values);
}
Expand Down

0 comments on commit 116eb6c

Please sign in to comment.