Shop OBEX P1 Docs P2 Docs Learn Events
Control the basic stamp with my PC — Parallax Forums

Control the basic stamp with my PC

solixsolix Posts: 7
edited 2010-01-18 16:25 in BASIC Stamp
Hi, I have a BoeBot using the basic stamp and I wish to control it with a program I'll make using C++.
I'd just like to be able to know what's in the "debug terminal" and to be able to send a "signal" to the basic stamp to tell him I'm ready.
If any one knows the answer, that would be really cool =)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-12 17:57
    The DEBUG and DEBUGIN statements are just special cases of the SEROUT and SERIN statements and transmit and receive ordinary asynchronous serial data. For all Stamps except the BS2px, they work at 9600 Baud. The PC interface circuitry on the Stamp echos any received data back to the PC, so you have to account for that in your program. The debug window in the Stamp Editor is just a simple terminal emulator similar to HyperTerm.
  • solixsolix Posts: 7
    edited 2010-01-12 18:09
    Thank's for that quick reply Mike Green [noparse]:)[/noparse]
    But i'm stuck at the really beginning : I don't know how to send "signals" to my BoeBot with my C++ program. I must use the basic stamp editor but it's not what I want [noparse];)[/noparse]
    Do you have any idea ?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-12 18:26
    You will have to learn how to get your C++ to send and receive data via a serial (COM) port, probably by consulting your C++ documentation. It's not the purpose of this forum to teach you how to do that. If you browse this forum, you may be able to find examples of this for some C++ implementations since the question has come up before and others have posted their programs. I don't have a link handy.
  • velociostrichvelociostrich Posts: 40
    edited 2010-01-12 21:09
    You'll need to read the documentation accompanying the PBASIC Tokenizer to program a BASIC Stamp, which can be obtained here.

    As for communicating with the BASIC Stamp, you could take a look at the BASIC Stamp Tools for Linux source code, but I don't know how portable it is.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-13 13:57
    You can program the BS2 using the IDE, so that's not a problem.

    On the BS2 side, you need to use a "SERIN" statement to recieve data from your PC.
    SERIN 16, 16468, [noparse][[/noparse]DEC MyVar]

    On the PC side, you need to send out the serial port some data.
    The BS2 will 'pend' waiting for the data from the PC.

    Oh, and note everything the PC sends to the BS2 will be 'echoed' back by the BS2 hardware, so
    if you want to recieve data from the BS2, you'll need to 'filter' out that echo in your C++ program.

    Typically people use 9600 baud to talk to the BS2.
  • solixsolix Posts: 7
    edited 2010-01-15 18:04
    Thanks you allanlane5, that's really helping me [noparse];)[/noparse]
  • Brian_BBrian_B Posts: 842
    edited 2010-01-18 02:48
    Here is a link to program the serial port in VB2008 , I have used it as a template for some PC to basic stamp control projects . C++ works the same if you know how to access the serial port

    http://www.serialporttool.com/NCD/R8X_VB2008.htm



    Brian

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔





    "Imagination is more important than knowledge..." Albert Einstein
  • solixsolix Posts: 7
    edited 2010-01-18 16:25
    Wow, thanks a lot Brian_B
Sign In or Register to comment.