Button Control in VB 2008
NWUpgrades
Posts: 292
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
' {$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 Savage
Parallax Engineering