PDA

View Full Version : send data between 2 microcontrollers by ir(infrared)



FADI984
- 10th November 2011, 00:04
hi for all ........it's long time ago since i start serch for complete my idea but i failed .....
i am trying to send data(like numbers 1,2,3,....) between two pic16f628a by ir ,i have tested my idea ...as next
in trans section i configured pwm to 38khz and i used serout2 command to send data as next
start:
serout2 portb.0,813,[23,5,8,9]
pause 100
goto start
------------------------
in recieve section
i used serin2 and i connect lcd to display the recieved data
x var byte
y var byte[4]
pause 300
lcdout $fe,1
start:
serin2 portb.0,813,300,timeout,[wait(23),str y\3]
lcdout dec y[0],dec y[1],dec y[2]
goto start
for test i connect trans pin to recieve pin directly and i have recieved instead of numbers 3,8,9 ...numbers 224,273,223
can any one help me ....please........please

RFEFX
- 14th November 2011, 17:05
What values are you receiving without declaring them as "DEC" ?

Archangel
- 23rd November 2011, 06:20
Bruce has many examples on his site, here is one you might find useful:
http://www.rentron.com/Infrared_Communication.htm
and his site index:
http://www.rentron.com/PicBasic/Rentron.htm
you can spend (invest ?) lots of time in here.