Receiver Code:
RX CODE:
trisb symbol = 134
Tris symbol = 133
Portbou symbol = 6
symbol port = 5
poke Tris, 0
poke port, 0
low 0
Input 1
prestart:
pause 400
poke port, 10
pause 200
poke door, 5
pause 200
poke port, 6
pause 200
poke door, 9
pause 200
poke port, 0
pause 200
start:
Serin 1, n9600, B0
if B0 = 1 then forward
if B0 = 2 then backward
if B0 = 3 then left
B0 = 4 if then right
if B0 = 5 then nomove
goto start
Forward:
poke port, 10
goto start
backward:
poke door, 5
goto start
right:
poke port, 6
goto start
left:
poke door, 9
goto start
nomove:
poke port, 0
goto start
End
Transmitter Code:
TX CODE:
trisb symbol = 134
Tris symbol = 133
Portbou symbol = 6
symbol port = 5
1 low
Input 0
Input 2
start:
0.50 pot, B0
2.50 pot, B1
B0 = B0 * 5
B1 = B1 * 5
y:
if B0 <100 then YF
if B0> 150 then yb
x:
if B1 <100 then xr
if B1> 150 then xl
serout 1, n9600, (5)
goto start
YF:
serout 1, n9600, (2)
goto start
yb:
serout 1, n9600, (1)
goto start
xl:
serout 1, n9600, (3)
goto start
xr:
serout 1, n9600, (4)
goto start
End
The pic16f84a
I can not generate the hex to save the pic





Bookmarks