The only difference in the code is that the pcDuino uses I2C bus 2 for the SCL and SDA pins -
bus = smbus.SMBus(2) # pcDuino uses bus 2
# I2C address 0x29
# Register 0x12 has device ver.
# Register addresses must be OR'ed with 0x80
ver = bus.read_byte(0x29)
# version # should be 0x44
if ver == 0x44:
print "Device found\n"
bus.write_byte(0x29, 0x80|0x00) # 0x00 = ENABLE register
bus.write_byte(0x29, 0x01|0x02) # 0x01 = Power on, 0x02 RGB sensors enabled
bus.write_byte(0x29, 0x80|0x14) # Reading results start register 14, LSB then MSB
data = bus.read_i2c_block_data(0x29, 0)
clear = clear = data << 8 | data
red = data << 8 | data
green = data << 8 | data
blue = data << 8 | data
crgb = "C: %s, R: %s, G: %s, B: %s\n" % (clear, red, green, blue)
print "Device not found\n"
To keep this example simple, I have left the timing/power consumption for the analog to digital converters on the sensor board and sensor gain at their default values. For more information about these (and other settings) see the datasheet.