schreiner
11-18-2009, 01:05 PM
I have a BLINKM LED device which speaks I2C and am having getting code to work with the BS2px using the I2COUT and I2CIN commands.· Actually I have no problems sending commands to the BLINKM using the I2COUT command but I cannot read data from the BLINKM using the I2CIN command.· I try to read the I2C address of the BLINKM but only get 0x255 in return even though the device is at address 0x01.· The I2CIN command format in the help for PBASIC is confusing because the examples do not include the slaveid parameter.
Can anyone provide sample code or clear up my thinking of the I2CIN command specifically for its use with the BLINKM device?
I was trying these instruction sequences when atempting to read the address of the BLINKM:
I2COUT 0, 1, ["a"]
PAUSE 100
I2CIN 0, 1, [dev_address1]
DEBUG dev_address1
and this sequence:
I2CIN 0, 1, $61, [dev_address1]
DEBUG dev_address1
·
Can anyone provide sample code or clear up my thinking of the I2CIN command specifically for its use with the BLINKM device?
I was trying these instruction sequences when atempting to read the address of the BLINKM:
I2COUT 0, 1, ["a"]
PAUSE 100
I2CIN 0, 1, [dev_address1]
DEBUG dev_address1
and this sequence:
I2CIN 0, 1, $61, [dev_address1]
DEBUG dev_address1
·