Shop OBEX P1 Docs P2 Docs Learn Events
Serout — Parallax Forums

Serout

John BoardJohn Board Posts: 371
edited 2011-12-13 14:19 in BASIC Stamp
Hi All,

I'm new to the forums, and I have a problem (not many people hear from me when I don't :P),

I am using a BS2px and am trying to send this:

SEROUT 16,32,[$80,2,68]

To my computer. I know there I am using the "32" baud mode. However, I have no idea what the 32 refers to. For example, how can I find out what setting a 9600 baud mode is? I hope this makes sense, and please answer soon!

-John

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2011-12-06 18:20
    In the PBASIC editor (where you write your programs) there's a help button that will take you to a screen where you can bring up information on any of the PBASIC commands. The entry for SEROUT explains how the "32" is calculated, but you really don't need to know it - you just need to read the tables that are found immediately below that information. There you'll see that 9600 baud is 396, if you're using 8 data bits, no parity, true polarity. If it's inverted, 9600 would be 16780.

    I'm not sure why you'd be trying 32 for your baudmode. That would correspond to an extremely quick baud value. Can you explain why that's the number you're using?
  • John BoardJohn Board Posts: 371
    edited 2011-12-06 18:47
    Hi sylvie369, thanks for responding :)

    32... err... I was at that time just desperate for anything, so I was searching the internet and found a PIC table of bauds (I think). So I was using whatever I found.

    Ohh, and one last thing, what should this code display in the PST:

    SEROUT 16,396,[$80,2,68]

    Thanks again, and good meeting you,

    John
  • sylvie369sylvie369 Posts: 1,622
    edited 2011-12-07 03:47
    Hex 80 ($80) is a Euro sign.
    2 is an unprintable character ("Start of Text"), which will probably screw up anything else you try to send.
    68 is a capital letter "D".

    When I try your SEROUT statement I just get the Euro sign, not surprisingly.

    You can see what each code should send out by looking at an ASCII table like this one:

    http://www.ascii-code.com/

    Try

    SEROUT 16, 396, [74,$6F,$68,110]

    for example.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-12-07 04:50
    "I was searching the internet and found a PIC table of bauds (I think). So I was using whatever I found."
    ???
    Why?

    PBASIC Help, part of the IDE (the Stamp programming app), tells all in detail.
  • John BoardJohn Board Posts: 371
    edited 2011-12-10 01:53
    You have to understand that I was desperate at that point, and I hadn't thought of the Parallax Forums (*Bing!*).
  • sylvie369sylvie369 Posts: 1,622
    edited 2011-12-10 06:40
    Next time start here on the Parallax Forums. We're smarter than the rest of the internet.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-12-10 06:55
    ???
    You have to understand that I was desperate at that point, and I hadn't thought of the Parallax Forums (*Bing!*).

    Why despair when PBasic Help is there?

    ghtwht.jpg
    573 x 150 - 22K
  • doggiedocdoggiedoc Posts: 2,240
    edited 2011-12-10 07:14
    sylvie369 wrote: »
    We're smarter than the rest of the internet.
    That made me laugh out loud!

    Welcome to the Parallax Forums, John Board!

    Paul
  • John BoardJohn Board Posts: 371
    edited 2011-12-10 13:32
    Yeah, it made me laugh too :P

    I had thought of the PBASIC help, however, I couldn't find what I was after. However, that is bast now, and I have made my robot base using the BOE with a BS2px and 2 gearboxes and a serial motor driver. I can tell you, it was so good seeing it moving around the floor :)

    Thanks for all your help everyone,

    John
  • sylvie369sylvie369 Posts: 1,622
    edited 2011-12-12 05:45
    Congratulations, John. Fun, isn't it?
  • John BoardJohn Board Posts: 371
    edited 2011-12-13 14:19
    I have been doing robotics for quite a long time before I came to the Parallax forums.

    I started out with Lego mindstorms... I soon moved onto:
    The BOE-Bot where I learned quite a bit more for robotics:
    Then the Octobot, a robot powered by the PropStick.
    Then back to BOE-Bot temporarily for the RoboCup Junior Comps in Australia. (I came 3rd in regional and 8th out of 58 teams at state :)).

    The robot that I am building now is gonna be for next years RCJA (RoboCup). I am wanting it to be powered by the Prop and it will use some of the TAOS color sensors for the line following.

    Anyway, thanks again for the help;

    -John Board
Sign In or Register to comment.