Shop OBEX P1 Docs P2 Docs Learn Events
Two serial in, one out — Parallax Forums

Two serial in, one out

SmoothmachinesSmoothmachines Posts: 2
edited 2010-11-08 06:18 in BASIC Stamp
Hi!
I would like to input two barcode scanners into the STAMP and after processing send the info to a serially controlled DMX controller.
First, is it possible to use the STAMP as a switch/hub for the two scanners?
(i can input any serial string that fits the STAMP)
Then, is it possible to poll wich scanner was first to input and take a note of it so i can take a new decision depending on the second scanner inputing a string within a given time?
Thanks for advice!
All the best from Sweden
Bruno

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2010-11-05 10:22
    Bruno,

    It is possible to read two (or more) serial devices with the Stamp. However, you can only deal with one at a time. Also, the Stamp has no serial buffer so you actually have to have the program waiting for the serial string when it appears.

    In simple form, you could do this:
    Program waits for serial string from scanner #1.
    Receive serial data #1
    Program waits for serial string from scanner #2
    Receive serial data #2
    Process data and send serial string to DMX.

    Cheers,
  • SmoothmachinesSmoothmachines Posts: 2
    edited 2010-11-07 07:25
    Hi and thanks for reply!
    Yes, this discribes exactely the idea, nice to hear it is possible.
    Would you label this as advanced programming?
  • stamptrolstamptrol Posts: 1,731
    edited 2010-11-08 06:18
    This is a relatively simple SERIAL program. Depending on your experience to date, you'll find it more or less challenging.

    Start by reading one scanner and displaying with DEBUG. Then get the second scanner data. Finally, process the data and SEROUT to the DMX.

    Ask questions as you go along.
Sign In or Register to comment.