How do I set up a push button..? for sumo bot?
Hi,
well I finally got my sumo bots servo's connected, and I am going to do a presentation on microcontrollers for my (computer sci-100) class this monday... and I wanted to show off my mini-sumo-bot (home brewed version)... but I cant figure out how to hook up a pushbutton? what pins it should go to ect... also what code I should use for a 5sec delay ect. I think I just want it to do a little dance/demo ( because I won't have to sensors up and running by then).
So if some one could help me out that would be great!
thanks!
-Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio
well I finally got my sumo bots servo's connected, and I am going to do a presentation on microcontrollers for my (computer sci-100) class this monday... and I wanted to show off my mini-sumo-bot (home brewed version)... but I cant figure out how to hook up a pushbutton? what pins it should go to ect... also what code I should use for a 5sec delay ect. I think I just want it to do a little dance/demo ( because I won't have to sensors up and running by then).
So if some one could help me out that would be great!
thanks!
-Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio

Comments
·· You can find schematics on connecting a button to the SumoBot (Or any BASIC Stamp) in the Help File under the BUTTON command.· Now, I am not recommending the BUTTON command for your application, but the circuits apply to almost anything.· The code will be dependant on what you have and where in the code you want to read the buttons.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
· http://www.parallax.com/detail.asp?product_id=28152
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
·
I want to run this moter testing code after Said button is pressed ( the button is hooked up to pin 9) .
' -----[noparse][[/noparse] Title ]---------------------------------------------------------------- ' Mini Sumo 2.1 : Motor Test ' {$STAMP BS2} ' -----[noparse][[/noparse] I/O Definitions ]------------------------------------------------------ LMotor CON 13 ' left servo motor RMotor CON 12 ' right servo motor ' -----[noparse][[/noparse] Constants ]------------------------------------------------------------ LFwdFast CON 1000 ' left motor forward; fast LFwdSlow CON 800 ' left motor forward; slow LStop CON 750 ' left motor stop LRevSlow CON 700 ' left motor reverse; slow LRevFast CON 500 ' left motor reverse; fast RFwdFast CON 500 ' right motor forward; fast RFwdSlow CON 700 ' right motor forward; slow RStop CON 750 ' right motor stop RRevSlow CON 800 ' right motor reverse; slow RRevFast CON 1000 ' right motor reverse; fast ' -----[noparse][[/noparse] Variables ]------------------------------------------------------------ pulses VAR Byte ' counter for motor control ' -----[noparse][[/noparse] Initialization ]------------------------------------------------------- Start_Delay: PAUSE 2000 ' time to disconnect cable ' -----[noparse][[/noparse] Main Code ]------------------------------------------------------------ Main: FOR pulses = 1 TO 125 ' forward slow - about 12 inches PULSOUT LMotor, LFwdSlow PULSOUT RMotor, RFwdSlow PAUSE 20 NEXT FOR pulses = 1 TO 110 ' pivot turn - left wheel (ccw) PULSOUT LMotor, LStop PULSOUT RMotor, RFwdSlow PAUSE 20 NEXT FOR pulses = 1 TO 50 ' forward fast PULSOUT LMotor, LFwdFast PULSOUT RMotor, RFwdFast PAUSE 20 NEXT FOR pulses = 1 TO 30 ' spin turn - clockwise PULSOUT LMotor, LFwdFast PULSOUT RMotor, RRevFast PAUSE 20 NEXT Hold_Position: PULSOUT LMotor, LStop PULSOUT RMotor, RStop PAUSE 20 GOTO Hold_PositionCan some one help me make a code that will do this? or atleast get me started.
thanks so much!
-Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio