Shop OBEX P1 Docs P2 Docs Learn Events
Button Control in VB 2008 — Parallax Forums

Button Control in VB 2008

NWUpgradesNWUpgrades Posts: 292
edited 2009-06-19 19:42 in BASIC Stamp
Currently with the help of Jeff, I am able to communicate via serial port to my Boe Bot Servo motors using the following code on my BS2 Chip: I also attached the document for the VB 2008 code, etc. What I would like to do is to create a Button, rather than the Track Bars that are in the VB program. I know how to add the Buttons, but I am not sure of the data settings, as they are not the same type as the Track Bar and therefor a little difficult to copy the settings. Any help is appreciated.

' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM1}
·· 'Servo1 connected to pin12 servo2 connected to pin13

····· x VAR Word
····· y VAR Word
··· main:
····· GOSUB Servos
····· PULSOUT 12,x
····· PULSOUT 13,y
· GOTO main
··· Servos:
··· SEROUT 16, 16572,[noparse][[/noparse]"RDY",10]
··· SERIN 16,16572,15,timeout,[noparse][[/noparse]WAIT("!"),DEC4 x,DEC4 y]
· timeout:
··· PAUSE 15
··· RETURN

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-06-19 19:42
    How do you want the buttons to operate? Will they increment/decrement the pulse value? Set it to a specific point? It is important to know this because the track bars were very specific in their operation and it’s unclear if you’re trying to duplicate that with buttons or implement some other alternate function. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.