Hi everybody
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[1] << 8 | data[0]
green = data[3] << 8 | data[2]
blue = data[5] << 8 | data[4]
clear = data[7] << 8 | data[6]
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.
Kind regards,
Adrian Wyss