Skip to content

Conversation

@ky28059
Copy link
Member

@ky28059 ky28059 commented Mar 26, 2023

If we lose communication with the sensor over I2C, we don't need to reinitialize the connection to start receiving data again; initializing the device only writes config settings to the color sensor. AFAIK I2C is not bidirectional and so we don't need to "handshake" before the sensor starts sending data to the RIO; rather, the RIO sends read requests to the sensor (when we call .getColor() in this case).

image

I think all reconstructing the sensor does is send unnecessary I2C write requests and spam console with errors.

@ky28059 ky28059 force-pushed the dont-reconstruct-color-sensor branch from 1c578e1 to afee262 Compare March 27, 2023 20:26
@e3l
Copy link
Contributor

e3l commented May 8, 2023

do these write to registers on the color sensor itself? if so, it might be necessary to reconnect to the color sensor -- this data might be lost when power is dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants