Shop OBEX P1 Docs P2 Docs Learn Events
Visual Basic and Stamp2 — Parallax Forums

Visual Basic and Stamp2

ChillimanChilliman Posts: 7
edited 2009-07-07 02:24 in BASIC Stamp
Hi.
not user how to do this.
i need to be able to use and visual basic program to be able to use basic stamp 2, i need to know what i need on the stamp 2 and what i require on the VB side of things does any one know a good source of info.

chilliman hop.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-04 02:29
    The easiest way to communicate between a Stamp and a PC (in general) is to send ordinary serial information. On the Stamp end, this involves the SERIN and SEROUT statements (see the Manual for details). If you want to use the built-in USB port on many Stamp boards, you would use port #16 which is a special case for a pin number. Limitations of this port are discussed in the Manual. Most important is that data sent from the PC is echoed back to the PC. The Stamp actually does the same thing, but can't receive and transmit at the same time, so it discards the echoed information. The speed is set in the SERIN and SEROUT statements and would work best at 2400 Baud. Higher speeds (up to 9600 Baud) may be possible depending on what you're trying to do.

    On the PC end, you need to set up an ordinary serial port, usually at 2400 Baud. You'll need to look at the Visual Basic documentation for details.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-07-04 02:33
    You might find this link useful http://forums.parallax.com/showthread.php?p=671804

    Jeff T.
  • ChillimanChilliman Posts: 7
    edited 2009-07-04 13:04
    thanks guy's
    i will have a try, i may get back to you if i have any problems

    thanks
    chilliman
  • ChillimanChilliman Posts: 7
    edited 2009-07-06 19:29
    Hi.Guys
    i have got the VB to talk to my Basic Stamp it works great the next problem i have i would like to check six pins on the Stamp for their state and be able to pull all six states back to my VB program does any one know what code i would need to do this on the stamp before i can start looking at the code in VB, any help would be appreciated .

    Thanks
    Chilliman turn.gif
  • Mike2545Mike2545 Posts: 433
    edited 2009-07-06 23:18
    You probably could use the POLLIN and check the pins as often as you need and send a serial response to the VB program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-07-07 00:32
    Hi, I would try and design it so that the six pins were contigous , lets say P0 through P5. You could then monitor those 6 pins simultaneously using the INL instruction (look under memory and variables in the PBasic IDE help file).

    INL is a byte so transmitting one byte to the VB program on your PC would carry the information that contains the pin states , bit 0 would be P0 bit 1 would be P1 etc.

    eg

    myvariable = INL

    SEROUT [noparse][[/noparse]myvariable]

    Jeff T.
  • ChillimanChilliman Posts: 7
    edited 2009-07-07 02:24
    Unsoundcode.
    i am not sure what you mean with INL (i am new at this) a little more help would be appreciated to show me what you mean and to get me to under stand what i need to do.

    Thanks
    Chilliman confused.gif
Sign In or Register to comment.