Skip to content
Rodion Gorkovenko edited this page Mar 4, 2018 · 2 revisions

Testing addr+W sending on bitbang i2c (pins 10=sda, 11=scl)

10 scl=11
20 sda=10
30 pin sda;-1
40 pin scl;-1
50 print "Addr:"
60 input d
65 d=d*2
70 pin sda;0
75 pin scl;0
80 i=8
85 pin sda;-(d/128)
87 pin scl;-1
89 pin scl;0
91 d=(d*2)%256
92 i=i-1
93 if i>0; goto 85
95 pin sda;-1
97 pin scl;-1
99 print "ack="; pin(10)
100 pin scl;0
102 pin scl;-1
104 pin sda;-1
110 end
Clone this wiki locally