For a schoolproject I try to build a sorting machine.
I am using the Grove I2C Color Sensor TCS3414CS and have some struggle with it.
I got it to work and I am able to see the red, green and blue values.
My problem is, that there are no big differences if i hold something red or something blue under the sensor.
I programmed the Sensor in python and this is what it looks like:
bus.write_byte(0x39,0x80|0x12) bus.write_byte(0x39, 0x80|0x00) bus.write_byte(0x39, 0x01|0x02) bus.write_byte(0x39, 0x80|0x14) data = bus.read_i2c_block_data(0x39, 0) red = data << 8 | data green = data << 8 | data blue = data << 8 | data clear = data << 8 | data farbe = "Clear: %s, Red: %s, Green: %s, Blue: %s\n" % (clear, red, green, blue) print farbe
I’m looking forward to a solution of this problem.