Skip to content
Snippets Groups Projects
Verified Commit 8de07304 authored by Jakub Vaněk's avatar Jakub Vaněk
Browse files

Fix the reconnection sequence of EV3 color sensor after calibration

I have missed that the sensor enters the "STATE_CALIBRATE_DONE" state
after the calibration. From the reverse-engineered sources it seems to me
that in this mode, the sensor will no longer process CMD-SELECT messages.

This commit should fix this by cutting off NACKs to the sensor and
letting it reboot.
parent e6fba080
No related branches found
No related tags found
1 merge request!13Make the EV3 color sensor calibration applicable to the EV3 color sensor
......@@ -223,5 +223,8 @@ class ColorSensor(EV3UartSensor):
while items[0] == 0:
items = self.read_raw_mode(ColorSensor.MODE_COL_CAL)
# switch the sensor back to a mode where it will not time out
# restart the sensor (after the calibration it will be stuck in the COL-CAL mode)
self.start_reset()
# wait for reconnect
self.reflection()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment