Shop OBEX P1 Docs P2 Docs Learn Events
serout code structure — Parallax Forums

serout code structure

Night-HawkNight-Hawk Posts: 2
edited 2010-08-12 23:55 in BASIC Stamp
I have played enough to understand the serin and out commands (really really roughly) but I'm working on trying to control a zoom lens that uses RS-232 or TTL commands and I'm not sure how to write the code. I have attached the files that show packet and related info......the question is do I just put the command syntax into the data [outputdata] field?

Serout tpin, baudmode, {pace,} [outputdata]
Serout tpin, baudmode, {pace,} [8x 01 04 07 00 FF]

The second question is about flow control which the device does not support. Can I send out serout commands only and have the device work properly? I've done that wirelessly (sent basic serial commands through supplied software) using Scott's servo controller and an xbee but this may be a new ball game.

I'm sure I'm missing most of the puzzle. Help if you can and thanks for reading!
458 x 444 - 140K
700 x 537 - 97K
675 x 448 - 133K

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2010-08-10 08:49
    Your're on the right path. Have a look in the Helpfile under SEROUT.

    The output data is separated by commas, in most cases:

    Serout tpin, baudmode,[hex2 8x,hex2 01,hex2 04,hex2 07,hex2 00,hex2 FF]

    Cheers,
  • Night-HawkNight-Hawk Posts: 2
    edited 2010-08-12 23:55
    stamptrol wrote: »
    [hex2 8x,hex2 01,hex2 04,hex2 07,hex2 00,hex2 FF]

    That was exactly what I wanted to know, thanks Tom :)
Sign In or Register to comment.