Posted: 08:02pm 31 Jul 2015 |
Copy link to clipboard |
 Print this post |
|
Hi all,
Has anyone tried reading a single byte of data into an array element?
I have a CGColorMax2 updated to "Colour Maximite MMBasic firmware V4.5" hooked up to one of BigMik's I/O panels by I2C (pullups enabled on panel).
Running the following code with variable t = 0 results in all 0's regardless of what pins of the PCF8574 IC are held high.
Changing the variable t = 1 all is fine!
' Test I2C
I2C open 100,500
I2C write &H20,1,1,0
Dim d1(2)
Pause 100
t = 1
Do
If t=0 Then
I2C read &H20,1,1,d1
Print MM.I2C,"==>",d1(0)
Else
I2C read &H20,1,1,d
Print MM.I2C,"==>",d
EndIf
Pause 500
Loop
Anyone see what I am doing wrong? 0r Have I stumbled across a bug?
Rob
Rob White |