need help programming my bs2e with servos
robonetics
Posts: 16
Hello All,
············ I'm looking for some help with the programming part, but so far, no one has helped me with programming.i am new at this using the bs2e board & a ssc-32 board. i've been learning as i go. i do know how to write programs in qbasic or vb6, but not with pbasic to get a servo to move etc.
i want to learn how to make a data base for my bipedal robot so it can think on it's own, also trying to find a better way to program the bs2e board with out using the SEROUT command for the servos being it use to much mem on the bs2e board.
below is a sample of programming i've been using. but get the error"out of mem",·want to fine or have someone else show me a better way to program the board using the servos.
the robot does have a IRPD & i want to program that into the robot also to use, but not sure how to. same goes for a ps2 controller port & a gws gyro.
any help,input or idea's would be great.
thankz
charlie
'*************************************
'*····· program type:STAMP BS2E···················· *
'*······· version:PBASIC 2.5························ ··· *
'*************************************
'* programmer: Charles W. Scilabro Jr·············· *
'*········· Date:8/27/05·································· *
'*·· Email: robonetics@hvc.rr.com····················*
'*************************************
'*········· File:·complete movements················· *
'*************************************
' {$STAMP BS2e}
' {$PBASIC 2.5}
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #10 p1300 #26 p900 #11 p1900 #30 p2500 #14 p2500 #29 p1600 #13 p1200 #28 p1500 #12 p2000 #21 p1200 t1000",13] 'standing pose
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p500 #20 p2300 #5 p1600 #19 p1000 #4 p2000 #18 p1500 #7 p100 #17 p1700 #3 p1500 #16 p1300 t1000",13]··············· 'arm pose
PAUSE 1000
start:
GOSUB leftarm
movehead:
SEROUT 15,6,[noparse][[/noparse]"#21 p1300 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#23 p1700 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p2000 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1700 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1500 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1300 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1000 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p500 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1350 t1000",13]
PAUSE 3000
GOSUB bendwaist
leftarm:
SEROUT 15,6,[noparse][[/noparse]"#6 p1500 #5 p2000 #4 p1000 #7 p1400 #3 p1700 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p2000 #5 p2000 #4 p1000 #7 p1400 #3 p1700 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p1500 #5 p1500 #4 p1500 #7 p1000 #3 p1000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p500 #5 p500 #4 p2000 #7 p500 #3 p500 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p2000 #5 p2000 #4 p1000 #7 p1500 #3 p1700 t1000",13]
PAUSE 1200
GOSUB rightarm
wavelefthand:
SEROUT 15,6,[noparse][[/noparse]"#6 p1800 #4 p1000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#4 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#4 p1000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#4 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p100 #5 p1600 #4 p2000 #7 p100 #3 p1500 t1000",13]··············· 'left arm pose
PAUSE 1000
GOSUB waverighthand
rightarm:
SEROUT 15,6,[noparse][[/noparse]"#20 p2300 #19 p1000 #18 p1500 #17 p1700 #16 p1300 t1000",13]··············· 'right arm pose
PAUSE 1000
GOSUB wavelefthand
waverighthand:
SEROUT 15,6,[noparse][[/noparse]"#20 p2300 #18 p1500 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#18 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#18 p1500 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#18 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#20 p2100 #19 p1000 #18 p1500 #17 p1700 #16 p1000 t1000",13]··············· 'right arm pose
PAUSE 1000
GOSUB movehead
bendwaist:
SEROUT 15,6,[noparse][[/noparse]"#21 p1500 t1000",13] ' HOME point
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#21 p1000 t1000",13] 'bends forward
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#21 p2000 t1000",13] ' bends backwards
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#21 p1500 t1000",13] 'home point
PAUSE 1000
GOSUB turnchest
turnchest:
SEROUT 15,6,[noparse][[/noparse]"#22 p1350 t1000",13] ' home point
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p1000 t1000",13] ' turns right
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p1350 t1000",13]· 'home point
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p2000 t1000",13]·· 'turns left
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p1350· t1000",13]· ' home point
PAUSE 3000
GOSUB left_leg
left_leg:
SEROUT 15,6,[noparse][[/noparse]"#10 p1300 #11 P2000 #14 P2500 #13 P1300 #12 P2000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P1300 #11 P1000 #14 P1000 #13 P1300 #12 P2000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P2000 #11 P1000 #14 P1000 #13 P1000 #12 P1500 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P1300 #11 P1000 #14 P1000 #13 P1800 #12 P1000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P1300 #11 P2000 #14 P2500 #13 P1300 #12 P2000 T1000",13]
PAUSE 3000
GOSUB right_leg
right_leg:
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P800 #30 P2500 #29 P1500 #28 P1600 T1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P1500 #30 P2000 #29 P1500 #28 P1600 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#27 p1100 #26 P1500 #30 P1500 #29 P1000 #28 P1000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P1500 #30 P1500 #29 P2000 #28 P2000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P800 #30 P2500 #29 P1500 #28 P1600 T1000",13]
PAUSE 3000
GOSUB home_point
home_point:
SEROUT 15,6,[noparse][[/noparse]"#21 p1500 #22 p1350 #23 p1300 #20 p2300 #19 p1000 #18 p1500 #17 p1700 #16 p1300 #6 p1500 #5 p2000 #4 p1000 #7 p1400 #3 p1700 #6 p1500 #5 p2000 #4 p1000 #7 p1400 #3 p1700 #27 p900 #26 P800 #30 P2500 #29 P1500 #28 P1600 t1000",13]
END
············ I'm looking for some help with the programming part, but so far, no one has helped me with programming.i am new at this using the bs2e board & a ssc-32 board. i've been learning as i go. i do know how to write programs in qbasic or vb6, but not with pbasic to get a servo to move etc.
i want to learn how to make a data base for my bipedal robot so it can think on it's own, also trying to find a better way to program the bs2e board with out using the SEROUT command for the servos being it use to much mem on the bs2e board.
below is a sample of programming i've been using. but get the error"out of mem",·want to fine or have someone else show me a better way to program the board using the servos.
the robot does have a IRPD & i want to program that into the robot also to use, but not sure how to. same goes for a ps2 controller port & a gws gyro.
any help,input or idea's would be great.
thankz
charlie
'*************************************
'*····· program type:STAMP BS2E···················· *
'*······· version:PBASIC 2.5························ ··· *
'*************************************
'* programmer: Charles W. Scilabro Jr·············· *
'*········· Date:8/27/05·································· *
'*·· Email: robonetics@hvc.rr.com····················*
'*************************************
'*········· File:·complete movements················· *
'*************************************
' {$STAMP BS2e}
' {$PBASIC 2.5}
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #10 p1300 #26 p900 #11 p1900 #30 p2500 #14 p2500 #29 p1600 #13 p1200 #28 p1500 #12 p2000 #21 p1200 t1000",13] 'standing pose
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p500 #20 p2300 #5 p1600 #19 p1000 #4 p2000 #18 p1500 #7 p100 #17 p1700 #3 p1500 #16 p1300 t1000",13]··············· 'arm pose
PAUSE 1000
start:
GOSUB leftarm
movehead:
SEROUT 15,6,[noparse][[/noparse]"#21 p1300 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#23 p1700 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p2000 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1700 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1500 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1300 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1000 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p500 t1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#23 p1350 t1000",13]
PAUSE 3000
GOSUB bendwaist
leftarm:
SEROUT 15,6,[noparse][[/noparse]"#6 p1500 #5 p2000 #4 p1000 #7 p1400 #3 p1700 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p2000 #5 p2000 #4 p1000 #7 p1400 #3 p1700 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p1500 #5 p1500 #4 p1500 #7 p1000 #3 p1000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p500 #5 p500 #4 p2000 #7 p500 #3 p500 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p2000 #5 p2000 #4 p1000 #7 p1500 #3 p1700 t1000",13]
PAUSE 1200
GOSUB rightarm
wavelefthand:
SEROUT 15,6,[noparse][[/noparse]"#6 p1800 #4 p1000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#4 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#4 p1000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#4 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#6 p100 #5 p1600 #4 p2000 #7 p100 #3 p1500 t1000",13]··············· 'left arm pose
PAUSE 1000
GOSUB waverighthand
rightarm:
SEROUT 15,6,[noparse][[/noparse]"#20 p2300 #19 p1000 #18 p1500 #17 p1700 #16 p1300 t1000",13]··············· 'right arm pose
PAUSE 1000
GOSUB wavelefthand
waverighthand:
SEROUT 15,6,[noparse][[/noparse]"#20 p2300 #18 p1500 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#18 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#18 p1500 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#18 p2000 t1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#20 p2100 #19 p1000 #18 p1500 #17 p1700 #16 p1000 t1000",13]··············· 'right arm pose
PAUSE 1000
GOSUB movehead
bendwaist:
SEROUT 15,6,[noparse][[/noparse]"#21 p1500 t1000",13] ' HOME point
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#21 p1000 t1000",13] 'bends forward
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#21 p2000 t1000",13] ' bends backwards
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#21 p1500 t1000",13] 'home point
PAUSE 1000
GOSUB turnchest
turnchest:
SEROUT 15,6,[noparse][[/noparse]"#22 p1350 t1000",13] ' home point
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p1000 t1000",13] ' turns right
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p1350 t1000",13]· 'home point
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p2000 t1000",13]·· 'turns left
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#22 p1350· t1000",13]· ' home point
PAUSE 3000
GOSUB left_leg
left_leg:
SEROUT 15,6,[noparse][[/noparse]"#10 p1300 #11 P2000 #14 P2500 #13 P1300 #12 P2000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P1300 #11 P1000 #14 P1000 #13 P1300 #12 P2000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P2000 #11 P1000 #14 P1000 #13 P1000 #12 P1500 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P1300 #11 P1000 #14 P1000 #13 P1800 #12 P1000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#10 P1300 #11 P2000 #14 P2500 #13 P1300 #12 P2000 T1000",13]
PAUSE 3000
GOSUB right_leg
right_leg:
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P800 #30 P2500 #29 P1500 #28 P1600 T1000",13]
PAUSE 1000
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P1500 #30 P2000 #29 P1500 #28 P1600 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#27 p1100 #26 P1500 #30 P1500 #29 P1000 #28 P1000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P1500 #30 P1500 #29 P2000 #28 P2000 T1000",13]
PAUSE 3000
SEROUT 15,6,[noparse][[/noparse]"#27 p900 #26 P800 #30 P2500 #29 P1500 #28 P1600 T1000",13]
PAUSE 3000
GOSUB home_point
home_point:
SEROUT 15,6,[noparse][[/noparse]"#21 p1500 #22 p1350 #23 p1300 #20 p2300 #19 p1000 #18 p1500 #17 p1700 #16 p1300 #6 p1500 #5 p2000 #4 p1000 #7 p1400 #3 p1700 #6 p1500 #5 p2000 #4 p1000 #7 p1400 #3 p1700 #27 p900 #26 P800 #30 P2500 #29 P1500 #28 P1600 t1000",13]
END
Comments
that would hold the SEROUT command and structure
then just use variables and direct them to the SendIt routine for opperation.
it took my code form 57% to 17%
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
thank you for your input.
charlie
·
I know you can use the· RUN, STORE, READ & WRITE commands to access these memory banks. Perhaps someone who has experience can show you how to do this.
·
I wish I could help you more.
·
Mike
http://forums.parallax.com/showthread.php?p=548359
this is where Jon explained it to me.· Look at the attachements
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
·· Please do not use ALL CAPS when posting messages in the forum.· As to your needing help on understanding lookup tables, it so hapens that we have a robot which makes use of lookup tables.· The Toddler Bot.· The manual can be downloaded from the link below (Bottom of the page).· Reading the section on lookup tables may help you with what you're trying to do.·
·· Since you'll be using lookup tables, you will also be able to easily make use of the extra memory on the BS2e, since the tables can be easily read across banks or EEPROM using the STORE command in conjunction with the READ/WRITE commands.
http://www.parallax.com/detail.asp?product_id=27311
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com