Code help
cjgaus
Posts: 2
can someone help me correct this picbasic code so it will run on my bs2 i have tried with no success.
'*********************************************
'* Simple Receiver (2400 baud)
'* For PIC18F452
'*********************************************
DEFINE OSC 20
inbyte var byte
OUTPUT PORTC.6
INPUT PORTD.1
main:
' 16780 is 2400 non-inverted
' Receive on Pin Port D1
SERIN2 PORTD.1,16780, [noparse][[/noparse]inbyte]
' debug to computer serial, just to see it
SEROUT2 PORTC.6, 16468, [noparse][[/noparse]inbyte]
' clear out inbyte. You see repeating zeros
' if you are losing signal
inbyte = 0
goto main
'*********************************************
'* Simple Receiver (2400 baud)
'* For PIC18F452
'*********************************************
DEFINE OSC 20
inbyte var byte
OUTPUT PORTC.6
INPUT PORTD.1
main:
' 16780 is 2400 non-inverted
' Receive on Pin Port D1
SERIN2 PORTD.1,16780, [noparse][[/noparse]inbyte]
' debug to computer serial, just to see it
SEROUT2 PORTC.6, 16468, [noparse][[/noparse]inbyte]
' clear out inbyte. You see repeating zeros
' if you are losing signal
inbyte = 0
goto main
Comments
Should work something like that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I am using cheap 433mhz rf transmitter on the arduino
and the 433mhz rf receiver on the basic stamp.