RF Joystick Kontrollü Robot
Transmitter Code:

TX CODE:

symbol trisb = 134 :symbol trisa = 133
symbol portb = 6   :symbol porta = 5
low 1    :input 0 :input
;----------------------------------------------------
start:
pot 0,50,B0

pot 2,50,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
Receiver Code:

RX CODE:

symbol trisb = 134
symbol trisa = 133
symbol portb = 6
symbol porta = 5
poke trisa, 0
poke porta, 0
low 0
input 1

prestart:
pause 400
poke porta, 10
pause 200
poke porta, 5
pause 200
poke porta, 6
pause 200
poke porta, 9
pause 200
poke porta, 0
pause 200

start:
serin 1,n9600,B0
if B0 = 1 then forward
if B0 = 2 then backward
if B0 = 3 then left
if B0 = 4 then right
if B0 = 5 then nomove
goto start

forward:
poke porta, 10
goto start

backward:
poke porta, 5
goto start

right:
poke porta, 6
goto start

left:
poke porta, 9
goto start

nomove:
poke porta, 0
goto start
end
TWS 34 VE RWS 34 RF modülleri kullanılarak yapılmış olan bu devre de 900 MHZ lik telefon anteni kulanılmıştır.
Bu modüllerle yaklaşık olarak 350 ila 500 feet arasındaki mesafelerde iletişim sağlayabiliriz.

1 Feet 30,48 cm dir

350 * 30,48 = 106,38 mt
500 * 30,48 = 152,40 mt



ALINTIDIR.

www.picpro.org


Custom Search