View Single Post
  #5   Spotlight this post!  
Unread 09-02-2016, 21:17
bkeeney bkeeney is offline
Registered User
FRC #1982
 
Join Date: Feb 2016
Location: Lenexa, KS
Posts: 2
bkeeney is an unknown quantity at this point
Re: I2C Color Sensor not working

So what we've experienced is that our addressing appears to be correct. We are able to turn the LED on and off.

What's not working is the I2C read. Code below:

byteAr = new byte[1];
boolean success = !ColorSensor.read(0x04, 1, byteAr);

The read is always returning true, which means the read has failed. If we ignore that and try to use the value in byteAr we get an index out of bounds exception.

Not sure where to go from here since it does not appear to be address related.

FWIW, we were able to connect the sensor to a Raspberry Pi and read from the various address locations. RoboRio no success.

Any ideas?
Reply With Quote