These Examples are in text format to allow copying and pasting EXAMPLES FROM LONG MANUAL /+++++++++++++++++++++++++++ Address 0 /Always specify a starting address Begin /Just a label that defines a point in the program, you could call it anything Move 10000 /This line moves the servos to the rotations in element 10000 Wait 20 /This is a short delay Move 10001 /This line moves the servos to the rotations in element 10001 Output 15 on /This line turns on the LED on the board Wait 20 /This is a short delay so the light stays on Output 15 off /This line turns off the LED on the board Goto begin /This line sends the interpreter back to the start you may also write "Goto 0" /Stop is not necessary because it's a continuous loop /Now tell the loader put data starting at element 10000 Address10000 /Notice that spaces are optional Position s1=10000 s2=12500 /That's 1MS for servo 1 and 1.25 for servo2 /The loader automatically moves to the next line (10001) Position s1=20000 s2=17500 /That's 2MS for servo 1 and 1.75 for servo2 /+++++++++++++++++++++++++++++ NEXT EXAMPLE /+++++++++++++++++++++++++++ Address 0 /Always specify a starting address begin /Just a label that defines a point in the program, you could call it anything Move 10000 rate=200 /This line moves the servos to the rotations in element 10000 Wait 20 /This is a short delay Move 10001 /This line moves the servos to the rotations in element 10001 Output 15 on /This line turns on the LED on the board Wait 20 /This is a short delay so the light stays on Output 15 off /This line turns off the LED on the board Goto begin /This line sends the interpreter back to the start you may also write "Goto 0" /Stop is not necessary because it's a continuous loop /Now tell the loader put data starting at element 10000 Address10000 /Notice that spaces are optional Position s1=10000 s2=12500 /That's 1MS for servo 1 and 1.25 for servo2 /The loader automatically moves to the next line (10001) Position s1=20000 s2=17500 /That's 2MS for servo 1 and 1.75 for servo2 /+++++++++++++++++++++++++++++ NEXT EXAMPLE /+++++++++++++++++++++++++++ Address 0 /Always specify a starting address begin /Just a label that defines a point in the program, you could call it anything Move 10000 /This line moves the servos to the rotations in element 10000 Wait 20 /This is a short delay Move 10001 /This line moves the servos to the rotations in element 10001 Output 15 on /This line turns on the LED on the board Wait 20 /This is a short delay so the light stays on Output 15 off /This line turns off the LED on the board DSR1=25 Goto begin /This line sends the interpreter back to the start you may also write "Goto 0" /Stop is not necessary because it's a continuous loop /Now tell the loader put data starting at element 10000 Address10000 /Notice that spaces are optional Position s1=10000 s2=12500 /That's 1MS for servo 1 and 1.25 for servo2 /The loader automatically moves to the next line (10001) Position s1=20000 s2=17500 /That's 2MS for servo 1 and 1.75 for servo2 /+++++++++++++++++++++++++++++ EXAMPLES SET FROM RATE MANUAL Example 1: Using the default DSR method and default speed Move 10,000 /Move using DSR1 Example 2: Using the default DSR method and specifying speeds DSR1=50 /Set DSR1 to 50 Move 10,000 /Move using DSR1 DSR1=250 /Change DSR1 to 250 Move 10,001 /Move using DSR1 Example 3: Using the default DSR method on one move and DSR2 with another move DSR2=50 /Set DSR2 to 50 Move 10,000 DSR2 /Move using DSR2 Move 10,001 /Move at the standard system DSR1 rate Example 4: Using the default DSR method and modifying speeds DSR1=50 /Set DSR1 to 50 Move 10,000 /Move using DSR1 (default) DSR1+10 /Increase the speed by 10 Move 10,000 /Move using DSR1 (default) Example 5: Vary the speed, the "yo-yo" program Here /Label DSR1=50 /Set DSR1 to 50 Do 40 /Set up a loop counter Move 10,000 /Move using DSR1 (default) Move 10,001 /Move using DSR1 (default) DSR1+10 /Increase the speed by 10 Loop /Back to the Do until finished Do 40 /Set up a loop counter Move 10,000 /Move using DSR1 (default) Move 10,001 /Move using DSR1 (default) DSR1-10 /Decrease the speed by 10 Loop /Back to the Do until finished Goto here /Go back and start over End Address 10,000 /Set the servo positions for two servos Position s1=12,500 s2=17,500 Position s1=17,500 s2=12,500 OTHER EXAMPLES EXAMPLE USING INPUT 1 /+++++++++++++++++++++++++++ /Note you may want to set the Run controls to run on power up /This is done in the Setup and Tools menu then Board parameters /With the board connected to your computer /Follow the instructions on that screen /Flash the On board LED ledflash /Start up line label output 15 on /turn off the led wait 5 /Delay output 15 off /Turn on the LEd wait 5 /Delay output 15 on /turn off the led wait 5 /Delay output 15 off /Turn on the LEd wait 5 /Delay dsr1=50 /Set the speed move 10,000 /Move the servos to the home position /address 10,000 has the base positions for the servos /When the program is started this is the first movement /Next is a wait loop this loop will wait until input 1 is make high /Once the output is made high, the program will continue on /When your code finishes, you can send the program back to home /You may want to send it back to ledflast home /Just a label if input 1=0 goto home /the ifinput instruction for input 1 output 15 on /Just a fast led flash wait 2 output 15 off /You may want to remove the above lines /You can also rem them out like this this line is ignored /output 15 on move 10,001 /First Position setup /Mouth closed head stright forward no tilt and eyes wide open /when the move is complete the controller will go on to the next line move 10,002 /First Position setup /Mouth open head left no tilt and eyes wide open move 10,003 /Mouth center head right no tilt and eyes wide open /You can repeat the moves using the loop command do 3 move 10,001 move 10,002 move 10,003 loop /Now make rwo fast moves dsr1=200 /Change the speed do 3 move 10,002 move 10,001 loop dsr1=50 /Change the speed back goto home end /+++++++++++++++++++++++++++ /Next Example walk routine for Lynxmotion brat /+++++++++++++++++++++++++++ /WWW.SCONCON.COM /4 Point Walk routine for Lynxmotion Brat using the Scon SB020 Board /Servos Ankle-Left Servo 1; Right Servo 2; Knee-Left Servo 3; Right Servo 4 /Servos connections Left Hip=Servo 5 – Right Hip Servo 6 wait 100 /A delay so it does not start right away DSR1=50 /Set DSR1 speed to 50 (DSR1 is the default moving speed) move 10150 /goto standing position (Use Memory Element 10150) wait 10 /This is the forward walk routine do 5 /Set up a loop counter This is the number of steps Move 10,100 /Move using DSR1 (default rate) Move 10,101 /Move using DSR1 (default rate) Move 10102 /Note that the (, comma) is optional Move 10103 Loop /Back to the Do until finished move 10150 /Go to standing position /This is the backward walk routine address 50 /Placed at 50 so that "Run at line number" control can be used DSR1=50 /Set DSR1 to 50 do 10 /Set up a loop counter this is the number of steps Move 10103 /Move using DSR1 (default) Move 10102 /Move using DSR1 (default) Move 10101 Move 10100 DSR1+5 /Increase the speed by 5 Loop /Back to the Do until finished move 10150 /Go to standing position /This is the forward walk routine again do 5 /Set up a loop counter This is the number of steps Move 10,100 /Move using DSR1 (default) Move 10,101 /Move using DSR1 (default) Move 10102 Move 10103 Loop /Back to the Do until finished move 10150 /goto standing position stop End /End of the program now set the servo positions /The address command indicates whish memory element to start placing data /The pulse (in ms) that the servo receives is 1/10000 of the value /Example 14457 is 1.4557 milliseconds Address 10,100 /Walk positions /First will be in element 10,100; Second will be 10,101 Position s1=14450 s2=14420 s3=17220 s4=17220 s5=16990 s6=17500 Position s1=15560 s2=15800 s3=17220 s4=17220 s5=16990 s6=17500 Position s1=15560 s2=15800 s3=12780 s4=12780 s5=12500 s6=13010 Position s1=14220 s2=14450 s3=12780 s4=12780 s5=12500 s6=13010 address 10150 /Standing position Position s1=15000 s2=15000 s3=15000 s4=15000 s5=15000 s6=15000 /Questions and comments always welcome at service@sconcon.com /WWW.SCONCON.COM