Shop OBEX P1 Docs P2 Docs Learn Events
Make basic stamp controlled by controller — Parallax Forums

Make basic stamp controlled by controller

andyisaginerandyisaginer Posts: 1
edited 2012-04-04 10:46 in BASIC Stamp
I was wondering if anyone could help me find a way to controll the basic stamp wirelessly by a controller

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-04 10:46
    The Basic Stamp remains "in control", but the program running on the Stamp communicates with the other controller via a wireless link and the program is written to respond to information received from the other controller.

    There is a wireless link called the Flash Fly that does allow for downloading a program wirelessly from a PC and theoretically could allow for downloading a program from some other type of controller (not a PC), but usually this is not how this sort of thing is done.

    Typically, the other controller would send some sort of command to the Stamp like the characters "!A5". The "!" serves as a marker for the start of a command. The "A" would be some sort of command and the "5" would be a numeric value that modifies the command. The Stamp would receive this using its SERIN statement, testing for each of several commands in turn, then doing whatever the command indicates. Depending on your application, the Stamp might signal back to the other controller in a similar fashion using the SEROUT statement to indicate that it's done with the command and maybe supply some additional information about what happened.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-04 10:46
    To control a BS2 or any microcontroller wirelessly you need to create a serial protocol to send it commands, perform tasks, and then respond if needed over a serial link. I've only used Bluetooth, but from what I've read XBee is similar. They support full duplex asynchronous serial. This is in fact identical to the link the BS2 uses for its DEBUG and DEBUGIN commands with the host PC. I find it's always easier to solve one problem at a time, so I use DEBUG and DEBUGIN to develop the protocol with the host PC acting as the controlling entity. I then interactively type in commands into the IDE's debug window and debug my protocol. I then switch to serin and serout on the pins for the wireless link (usually 0 and 2 for Bluetooth). I can then develop the code which invokes this controller from the other microcontroller.

    FYI This PDF contains some information on serin and serout if you need it http://www.parallax.com/dl/docs/cols/nv/vol1/col/nv16.pdf
Sign In or Register to comment.