Control BS2 from PC

Tronic (Greece)Tronic (Greece) Posts: 130
edited 2004-08-27 - 14:12:07 in Robotics
Hi I'm trying to control my basic stamp 2 in real time to move servos from a visual basic
program through Basic Stamps serial programming port the same way it does in GUIBOT
program·I found in parallax site.

The problem is that although I succesfully have send·serial data using the P16 I cannot
sent back data to PC. Can I guess that the out port from bs2 is P17 or I'm wrong?

I need the out port from the serial programming port to modify the code for handshaking
with visual basic and/or flow control.

the stamp source is:

pos VAR Byte
servo VAR Byte
start:
·· SERIN 16,16468,[noparse][[/noparse]servo,pos] 'get serial input from PC

move:
·· PULSOUT servo,pos ' send data to position servos
·· PAUSE 10
· GOTO start··· ' do it again
END

If someone can help!

·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-25 - 11:23:14
    Perhaps this will help: http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv89.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2004-08-25 - 14:19:08
    I cant use the normal ports (P0 - P15) as they occupied by servos so i'd like to make use
    of the existing serial port of my BS2 boebot board. That the reason I use P16 port for input.

    But i can't find the port to output data (P17 maybe?) to use it in basic stamp code for flow control with data sended from visual basic.

    for i.e:

    serin 16\17 , 16468, [noparse][[/noparse]servo,pos] 'get serial input from PC

    I saw real time control of servos implemeted in the "TEST" section of GUIBOT software that does something simular but there is no source code available to see how it is done.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-26 - 03:56:40
    No, that is not possible -- P16 is the programming port and can be used with SEROUT and SERIN only. If must have flow control, then you have to use part of the P0-P15 IO structure ... or you could do it in software: your program could send a little "I'm ready now" message to the PC and the PC could then send something back.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2004-08-26 - 10:14:21
    ok thanks. i'll use software flow control then.

    In the meantime enjoy a photo of my custom made boe bot crawler. (the cell phone is for comparison reasons)

    tongue.gif
    640 x 480 - 275K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-08-26 - 13:31:30
    Clever Tronic...Very clever...


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    ·
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2004-08-26 - 14:54:49
    if you liked the photo above check it in motion with this little video:
    the cat on the movie is my sister's and is very attractive to my crawler (IR sees white things from far) devil.gif


    just unrar and enjoy the show (it is in ASF format).

    ps: sorry about the rar & parts thing but i was not able to upload any file bigger than 300Kb!!!)
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2004-08-27 - 06:31:34
    another one in wmv...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-08-27 - 14:12:07
    That last one was funny!· I especially liked at the end when the cat just sat there and the bot bumped his rump.· He musta took off pretty fast!
    shocked.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    ·
Sign In or Register to comment.