Posted: 10:19am 23 Sep 2022 |
Copy link to clipboard |
 Print this post |
|
Master
SetPin gp0,gp1,i2c I2C open 100,1000 i=10 Do i=i+1 a$=Str$(i) I2C write 50,0,Len(a$),a$ Pause 200 I2C read 50,0,8,a$ Print a$ Pause 200 Loop
Slave
'GP29 is the input voltage divided by 3 and is always set as AIN SetPin gp2,gp3,i2c2 I2C2 slave open 50,tint,rint Do :Loop ' Sub rint Local count 'Print "RX" I2C2 slave read 10,a$,count a$=Str$(Pin(gp29),1,6) Print a$ End Sub ' Sub tint I2C2 slave write 8,a$ 'Print "TX" End Sub
You have a slave write in the receive interrupt. Edited 2022-09-23 20:20 by matherp |