MageJohn / EMPR_Scanner

1 stars 1 forks source link

Add support for the RGB sensor to the platform library #3

Open MageJohn opened 4 years ago

MageJohn commented 4 years ago

For starters, get a test working outside of the library. I've been carefully reading the datasheet and I think we need to follow this sequence:

Note that I don't think we need to resend the command byte setting the address to 0x14 each time we read from the chip; the datasheet says that it will always use the address specified in the last command byte, not the address of the last byte read.

Further note that the resolution of the data we read back will be limited by the integration time. At an integration time of 2.4 ms (the smallest, and the default) the max value will be 1024.

After getting the test code working, generalize it to a library. See the motors library for guidance if necessary.

This is just a rough outline and will probably evolve as it's being implemented.

MageJohn commented 4 years ago

I've been reading through Adafruit's library for the RGB sensor. Some interesting insights I've come across are: