Shop OBEX P1 Docs P2 Docs Learn Events
Serin/Serout Commands — Parallax Forums

Serin/Serout Commands

hamby551hamby551 Posts: 1
edited 2006-05-10 14:59 in BASIC Stamp
I set up the Schematic like it is in the Parallax book. I have done Serin/Serouts before, but I am having trouble doing it this time. I took all of my code, and just made a simple counter, and tried to get the other stamp to recive the number as it counted. My actual project involves 2 RFID Readers sending their tagNum they pick up over to the other stamp, which displays a speed limit based on that tag number, and as you turn a voltmeter, another display on that stamp goes up or down. It is designed so if your car drives over an RFID tag in the road, it can show you the speed limit of that road. The other RFID reader reads tags on a keychain and if the kid's keychain is read, the Speed of the car can never be greater than the speed of the road. We are working now with tri color LED's so that if they car is under the speed limit it is gree, if it is at the speed limit it goes orange and if you go over it goes red. With all of that code, I couldn't tell if it was something in my code messing up the SERIN, SEROUT commands. So I designed this simple code, and it still didn't work

x VAR BYTE

Main:
SERIN 15, $2d, 600, Main, [noparse][[/noparse]x]
PAUSE 2000
DEBUG X, CR
GOTO Main



x VAR BYTE


Main:
AUXIO
x = x+1
SEROUT 15, $2d, [noparse][[/noparse]X]
GOTO Main

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-09 18:06
    Moved to BASIC Stamp forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-10 14:59
    One of the problems you're having is that there is no flow control implemented in your code -- the sender is blasting out data and the receiver may or may not catch a byte along the way. You can either add a delay on the sender end (remove it from the receiver) or add another line and implement flow control (see the manual/help file for an example of using FC pins).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.