I have done with i2c between two 20X2 communicate use LEDs, send command use i2cmaster, and receive different i2cslave with if hi2cflag = 0 then, hi2cflag = 0, get hi2clast,b1 for partX2 only.
Anyway, I have trying use 08M2 send to 18M2 receive, same i2cmaster both, for practice with led first before own project, not working hi2cin nothing response LED, something wrong.
For the 08M2 sender
and for the 18M2 receiver
Sorry, I have tried to figure out how put code area on post, I cant remember where click add code or type.
Anyway, I have trying use 08M2 send to 18M2 receive, same i2cmaster both, for practice with led first before own project, not working hi2cin nothing response LED, something wrong.
For the 08M2 sender
Code:
'08M2 sender
hi2csetup i2cmaster, %11010000, i2cslow, i2cbyte
main:
let b1=2
hi2cout 0,(b1)
pause 500
let b1=3
hi2cout 0,(b1)
pause 500
goto main
and for the 18M2 receiver
Code:
'18M2 receiver
hi2csetup i2cmaster, %11010000, i2cslow, i2cbyte
main:
hi2cin 0, (b1)
if b1=2 then one
if b1=3 then two
goto main
one:
high C.1
goto main
two:
low C.1
goto main
Sorry, I have tried to figure out how put code area on post, I cant remember where click add code or type.
Last edited by a moderator: