Basic atom programming

That simply means that the label “start:” is used in more than one place in your program. That’s not allowed. You can also double click on the error line and the cursor will move to the line with an error.

This is the program i am trying to run do you know which start should i remove i tried removing the first start command and it did program succesfullly but nothing actually moved in the robot.

[code]’ Atom / SSC-32 Test

servo0pw var word
movetime var word

servo0pw = 1000
movetime = 2500

start:
servo0pw = 1000
serout p0,i38400,"#0P",DEC servo0pw,“T”,DEC movetime,13]
pause 2500
servo0pw = 2000
serout p0,i38400,"#0P",DEC servo0pw,“T”,DEC movetime,13]
pause 2500
goto start

’ Biped example program.
aa var byte '<- general purpose variable.
rax var word '<- right ankle side-to-side. On pin0
ray var word '<- right ankle front-to-back. On pin1
rkn var word '<- right knee. On pin2
rhx var word '<- right hip front-to-back. On pin3
rhy var word '<- right hip side-to-side. On pin4
lax var word '<- left ankle side-to-side. On pin5
lay var word '<- left ankle front-to-back. On pin6
lkn var word '<- left knee. On pin7
lhx var word '<- left hip front-to-back. On pin8
lhy var word '<- left hip side-to-side. On pin9
ttm var word '<- time to take for the current move.

’ First command to turn the servos on.
for aa=0 to 9
serout p0,i38400,"#", DEC2 aa\1, “P”, DEC 1500, 13]
next

start:
’ First position for step sequence, and time to move, put in your values here.
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
ttm=1000
gosub send_data
pause ttm

’ Second position for step sequence, and time to move, put in your values here.
rax=1600: ray=1600: rkn=1600: rhx=1600: rhy=1600
lax=1600: lay=1600: lkn=1600: lhx=1600: lhy=1600
ttm=1000
gosub send_data
pause ttm

’ Third…

’ Forth…

’ Etc…

goto start

’ This sends the data to the SSC-32. The serout is all one line. Use |!
send_data:
serout p0,i38400,"#0P",DEC rax,"#1P",DEC ray,"#2P",DEC rkn,"#3P",DEC |
rhx,"#4P",DEC rhy,"#5P",DEC lax,"#6P",DEC lay,"#7P",DEC lkn,"#8P",DEC |
lhx,"#9P",DEC lhy,“T”,DEC ttm,13]
return[/code]

Why did you attach the two programs? The first one is just moving the servo in two places…

Here is the proper program for the biped.

This code expects the SSC-32 to be connected to the Bot Boards pin0.

[code]’ Biped example program.
aa var byte '<- general purpose variable.
rax var word '<- right ankle side-to-side. On pin0
ray var word '<- right ankle front-to-back. On pin1
rkn var word '<- right knee. On pin2
rhx var word '<- right hip front-to-back. On pin3
rhy var word '<- right hip side-to-side. On pin4
lax var word '<- left ankle side-to-side. On pin5
lay var word '<- left ankle front-to-back. On pin6
lkn var word '<- left knee. On pin7
lhx var word '<- left hip front-to-back. On pin8
lhy var word '<- left hip side-to-side. On pin9
ttm var word '<- time to take for the current move.

’ First command to turn the servos on.
for aa=0 to 9
serout p0,i38400,"#", DEC2 aa\1, “P”, DEC 1500, 13]
next

start:
’ First position for step sequence, and time to move, put in your values here.
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
ttm=1000
gosub send_data
pause ttm

’ Second position for step sequence, and time to move, put in your values here.
rax=1600: ray=1600: rkn=1600: rhx=1600: rhy=1600
lax=1600: lay=1600: lkn=1600: lhx=1600: lhy=1600
ttm=1000
gosub send_data
pause ttm

’ Third…

’ Forth…

’ Etc…

goto start

’ This sends the data to the SSC-32. The serout is all one line. Use |!
send_data:
serout p0,i38400,"#0P",DEC rax,"#1P",DEC ray,"#2P",DEC rkn,"#3P",DEC |
rhx,"#4P",DEC rhy,"#5P",DEC lax,"#6P",DEC lay,"#7P",DEC lkn,"#8P",DEC |
lhx,"#9P",DEC lhy,“T”,DEC ttm,13]
return[/code]

Ok I think something still not right. I have connected the cable from the ssc32 to pin0 on the mini abb. In the ATOM pro IDE i click tools and program it send the data to the chip but how do i run it on the robot or is it just supposed to move once you click program.

Hi robot dude can I call you on the telephone and chat about this. may be send me your phone number to [email protected] i am in australia so need to know what time to call you i am gmt +10

If this code didn’t do anything it might be helpful for you to take a picture of how things are wired up, specifically the connections between the bot board and ssc-32, the jumpers on both the bot board and ssc-32, and how your power is connected to each.

to answer your question though, once the IDE finishes programming the atom it will reset the atom and execute this program.

the first thing the program does is initialize the first 10 (0 through 9) servo outputs to 1500mS (0 degrees). Obviously you need your servos connected to these outputs and they need to be powered.

the second operation sets all 10 outputs to 1400mS and it will take 1000ms (1 second) to complete.

similarly the third operations sets all 10 outputs to 1600mS and it will take 1000mS to complete the move.

after that the servos continue to move back and forth between 1400 and 1600 every 2 seconds (1 second in each direction) until you turn off the power.

Please don’t call me. International phone calls are expensive, and I don’t need the added pressure. We can solve this here.

The code is run immediately upon downloading to the chip. Does the SSC-32’s green LED go out and blink? If so this means it is receiving data from the Bot Board. Make sure the SSC-32’s baud rate jumpers are set to 38.4kbaud.

After downolading the program to the mcu, the ssc-32 needs to be jumpered for TTL communication and the baud mode set. Refer to the maunal. There are three jumpers in all that need to be set properly.

Hi robot dude

ITS WORKING FANTASTIC

thanks for your help man now I can walk. I have also built two arm for it with hands and fingers I guess i have a bit of code to write now. Cant beleve it I wanted to get this in the DARPA comp robot dog but mine is two legged with two arms so it can climb aswell dont know about carying 50kg on it back but it definatly alot better when it comes to stealth. Is there somewhere i can locate some code for the robonova rate gyros to stop it falling over when its pushed.

Thanks again your a legend

I think you are mixing this up Mike. If he is controlling the ssc-32 from a ABB/BAP and has the DC-01 wire from p0 of the ABB to the RX input of the SSC-32 ( as per the upper right part of this picture except using P0 and not P8 ) then he doesn’t need to do anything else once the program is downloaded. He does need power connected and jumpers set correctly on both boards for it to work though, which is why I went the picture route. :wink:

So, um, what changed between your posts so the rest of us can benefit from knowing the symptom of the problem and it’s resolution?

Yes, what was the problem… :wink: We need closure. lol

Awe shucks… :blush:

Perhaps this tutorial on the BRAT would help. It’s using an accelerometer though. Also it uses the Atom without the SSC-32, but it should prove helpful.
lynxmotion.com/images/html/build130.htm

I was refering to the three jumpers involed on the SSC-32 for TTL coms, there is the baud jumper(s), and there are two jumpers for the RX/TX pins. if he was using RS232 (on the SSC-32) for communication prior to programming the ABB, even though the bot board has nothing to do with the SSC-32’s config, its possible to over look setting the SSC-32 back to TTL serial communication. I have done this more than once when using the Visual Sequencer. :laughing:

May be spoke to early i changed the variable for

for aa=0 to 31 then set the relevant servos up as follows but only 0 to 9 work like the original code you posted. do i need to change something else to enable all servos 0 through 31.

’ Biped example program.
aa var byte '<- general purpose variable.
rax var word '<- right ankle side-to-side. On pin12
ray var word '<- right ankle front-to-back. On pin11
rkn var word '<- right knee. On pin10
rhx var word '<- right hip front-to-back. On pin9
rhy var word '<- right hip side-to-side. On pin8
lax var word '<- left ankle side-to-side. On pin28
lay var word '<- left ankle front-to-back. On pin27
lkn var word '<- left knee. On pin26
lhx var word '<- left hip front-to-back. On pin25
lhy var word '<- left hip side-to-side. On pin24
ttm var word '<- time to take for the current move.

’ First command to turn the servos on.
for aa=0 to 31
serout p0,i38400,"#", DEC2 aa\1, “P”, DEC 1500, 13]
next

start:
’ First position for step sequence, and time to move, put in your values here.
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
ttm=3000
gosub send_data
pause ttm

’ Second position for step sequence, and time to move, put in your values here.
rax=1600: ray=1600: rkn=1600: rhx=1600: rhy=1600
lax=1600: lay=1600: lkn=1600: lhx=1600: lhy=1600
ttm=2000
gosub send_data
pause ttm

’ Third…
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
ttm=4000
gosub send_data
pause ttm

’ Forth…
rax=1600: ray=1600: rkn=1600: rhx=1600: rhy=1600
lax=1600: lay=1600: lkn=1600: lhx=1600: lhy=1600
ttm=3000
gosub send_data
pause ttm

’ Fifth…
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
ttm=2000
gosub send_data
pause ttm

first only use the number of servos you need. Adding more servos than you need will add complexity for no reason.

You have increased the for next loop properly, but you have to have a variable for each of these additional servo positions to be stored. :wink:

Of you study the program closely you should be able to sort it out.

not sure what you mean I have 6 servos in total for each leg and 5 servos in each arm plus another 4 servos for tracking camera and aim up down left right for the laser beam

do they need to be numbered sequentially or something else

forgot this bit on the end

goto start

’ This sends the data to the SSC-32. The serout is all one line. Use |!
send_data:
serout p0,i38400,"#12P",DEC rax,"#11P",DEC ray,"#10P",DEC rkn,"#9P",DEC rhx,"#8P",DEC rhy,"#28P",DEC lax,"#27P",DEC lay,"#26P",DEC lkn,"#25P",DEC lhx,"#24P",DEC lhy,“T”,DEC ttm,13]
return

I’m not sure what you mean too. :wink: Ok, you have 26 servos. You will need a variable assigned for each servo. That way the value can be passed to the serout command. The way this example was written the servo pins need to be sequential. Anything on the right side of a ’ or ; are comments and are not seen by the compiler. :wink:

[code]’ Biped example program.
aa var byte '<- general purpose variable.

rax var word '<- right ankle side-to-side. On pin0
ray var word '<- right ankle front-to-back. On pin1
rkn var word '<- right knee. On pin2
rhx var word '<- right hip front-to-back. On pin3
rhy var word '<- right hip side-to-side. On pin4
lax var word '<- left ankle side-to-side. On pin5
lay var word '<- left ankle front-to-back. On pin6
lkn var word '<- left knee. On pin7
lhx var word '<- left hip front-to-back. On pin8
lhy var word '<- left hip side-to-side. On pin9
;(16 more servo variables go here, just like the 10 above)
ttm var word '<- time to take for the current move.

’ First command to turn the servos on.
for aa=0 to 25
serout p0,i38400,"#", DEC2 aa\1, “P”, DEC 1500, 13]
next

start:
’ First position for step sequence, and time to move, put in your values here.
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
; (the same 16 variable names from above go here)
; (do the same for the rest of them below)
ttm=3000
gosub send_data
pause ttm

’ Second position for step sequence, and time to move, put in your values here.
rax=1600: ray=1600: rkn=1600: rhx=1600: rhy=1600
lax=1600: lay=1600: lkn=1600: lhx=1600: lhy=1600
ttm=2000
gosub send_data
pause ttm

’ Third…
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
ttm=4000
gosub send_data
pause ttm

’ Forth…
rax=1600: ray=1600: rkn=1600: rhx=1600: rhy=1600
lax=1600: lay=1600: lkn=1600: lhx=1600: lhy=1600
ttm=3000
gosub send_data
pause ttm

’ Fifth…
rax=1400: ray=1400: rkn=1400: rhx=1400: rhy=1400
lax=1400: lay=1400: lkn=1400: lhx=1400: lhy=1400
ttm=2000
gosub send_data
pause ttm
goto start

’ This sends the data to the SSC-32. The serout is all one line. Use |!
send_data:
serout p0,i38400,"#0P",DEC rax,"#1P",DEC ray,"#2P",DEC rkn,"#3P",DEC |
rhx,"#4P",DEC rhy,"#5P",DEC lax,"#6P",DEC lay,"#7P",DEC lkn,"#8P",DEC |
lhx,"#9P",DEC lhy,“T”,DEC ttm,13]
return[/code]

If you would use the code button when posting it would make this more clear. The serout command will also need the additional 16 channels added to it as well.

OK i Understand how it works now thank you for your time . im going to get some sleep its 7am here falling asleep. zzzz :open_mouth: