Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't reconstruct color sensor if not connected #108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

None yet

2 participants