Hello, I have just purchased the Bot Board and BASIC 28 pin chip.
What i’m trying to program is a simple robot that has 6 servos and i what to test it out by just making it pick up an object. Nothing fancy, just trying to get the basics down. Could someone post some simple code for this (just servo one to 90 degrees and back to center or something)
Here is a simple code you can try. I would first start out by connecting only one servo to the ABB board with it not installed in anything.
' {$STAMP BS2}
' {$PBASIC 2.5}
counter VAR Word
PINx PIN 5 'Pin 5 uesed, change this number to the pin you want to use.
DO
FOR counter = 400 TO 728 STEP 5 '<change the step number to make servo move faster
PULSOUT pinx,counter
PAUSE 20
NEXT
FOR counter = 728 TO 1000 STEP 5
PULSOUT pinx,counter
PAUSE 20
NEXT
FOR counter = 1000 TO 728 STEP 5
PULSOUT pinx,counter
PAUSE 20
NEXT
FOR counter = 728 TO 400 STEP 5
PULSOUT pinx,counter
PAUSE 20
NEXT
LOOP
If he’ s using an Atom then a -5 is needed on the two decrementing for next loops. However if he is using an AtomPro then the Pulsout command uses .5us timings instead of 1us timings(on BS2 and Atom).
Yes, that is the BascAtom 28 pin module. I recommend you ask you question again in the BasicAtom forum. The code above was for the BS2. You’ll need to change a couple things to compile on the Atom.