Shop OBEX P1 Docs P2 Docs Learn Events
Code help — Parallax Forums

Code help

cjgauscjgaus Posts: 2
edited 2009-10-19 04:32 in BASIC Stamp
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

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-10-19 04:19
    '*********************************************
    '* Simple Receiver (2400 baud)
    '* [s]For PIC18F452[/s]
    '*********************************************
    [s]DEFINE OSC 20[/s]
    inbyte var byte
    [s]OUTPUT PORTC.6[/s]
    [s]INPUT PORTD.1[/s]
    main:
    [s]' 16780 is 2400 non-inverted[/s]
    [s]' Receive on Pin Port D1[/s]
    SERIN[s]2[/s] (insert port and baud here), [noparse][[/noparse]inbyte]
    ' debug to computer serial, just to see it
    DEBUG, [noparse][[/noparse]inbyte]
    ' clear out inbyte. You see repeating zeros
    ' if you are losing signal
    inbyte = 0
    goto main
    

    Should work something like that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • cjgauscjgaus Posts: 2
    edited 2009-10-19 04:32
    Trying it out now. I got the idea to connect a basic stamp to a arduino from here http://www.sparkfun.com/datasheets/RF/KLP_Walkthrough.pdf

    I am using cheap 433mhz rf transmitter on the arduino

    and the 433mhz rf receiver on the basic stamp.
Sign In or Register to comment.