Skip to content

Commit 3e6ce64

Browse files
dlechWasabiFan
authored andcommitted
Fix gyro sensor reset (#692)
Gyro sensor reset was failing because we were writing 17 bytes of 0 to the gyro sensor instead of the byte 17. Also change it to a bytes literal for max efficiency.
1 parent 8fd12cf commit 3e6ce64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ev3dev2/sensor/lego.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def reset(self):
631631
PiStorms, or with any sensor multiplexors.
632632
"""
633633
# 17 comes from inspecting the .vix file of the Gyro sensor block in EV3-G
634-
self._direct = self.set_attr_raw(self._direct, 'direct', bytes(17,))
634+
self._direct = self.set_attr_raw(self._direct, 'direct', b'\x11')
635635

636636
def wait_until_angle_changed_by(self, delta, direction_sensitive=False):
637637
"""

0 commit comments

Comments
 (0)