New, please point me in direction of guides

Hello, I am in a robotics class and am working with the autonomous BRAT kit (Bot Board II and AtomPro 28pin). I have assembled the kit and figured out the servo offsets, but when it comes to a resource for the actual syntax and program structure, I am at a loss.

For instance, I tried “Frankensteining” some code together from some of the autonomous ones to just make the servos move, but I get “[TOKEN MOVEMENT] : Expected Label” errors.

Are there any “complete newbie” guides to get me caught up with the language and how the programs are supposed to be structured?

The only goal set by my professor at this time is to get it to blindly walk, so I am not using any input from sensors or anything of that sort…so I think that I am just missing something simple >_<

Any help, links, etc. would be greatly appreciated. Thanks for your time.

It would be easier to help you with the error if you would post your code. The autonomous BRAT code already has the basic walking routine in it. You just need to modify the code to remove the sensor loop.

This tutorial…
lynxmotion.com/images/html/build130.htm

Step 7.
BRAT Autonomous Walk Code. It makes the robot follow this sequence: walk, walk, walk, turn, long-stride, long-stride, kick, turn, stop.

It’s fall off a log easy to change this routine. Really, just take a stab at modifying this code and it should be easy to point you in the right direction if you can’t get it.

Well, I figured I could snip out and so my little test code looked like the following:


righthip con p10
rightknee con p8
rightankle con p7
lefthip con p6
leftknee con p5
leftankle con p4

righthip_start con 1560
rightknee_start con -1320
rightankle_start con -1200

lefthip_start con -600
leftknee_start con 240
leftankle_start con 840

gosub movement 7.0,-20.0,-20.0, -7.0, 20.0, 20.0, 500.0]
gosub movement -7.0,-20.0,-20.0, 7.0, 20.0, 20.0, 500.0]
gosub movement -7.0, 20.0, 20.0, 7.0,-20.0,-20.0, 500.0]
gosub movement 7.0, 20.0, 20.0, -7.0,-20.0,-20.0, 500.0]


So I think I am missing some syntax or some callouts or something, bacause I get:

Error…TEST.BAS(LINE 16) : [TOKEN MOVEMENT] : Expected Label

Now, that would be right in the middle of the “gosub movement” commands…so is there something about “movement” that I need to define to use it properly in this context?

Thanks for your assistance :slight_smile:

You have a gosub command without a gosub label, or at least I don’t see it in your example. Anytime you have a gosub command, you have to have a label. See example:

righthip   con p10
rightknee   con p8	
rightankle   con p7	
lefthip      con p6	
leftknee   con p5	
leftankle   con p4

righthip_start con 1560
rightknee_start con -1320
rightankle_start con -1200

lefthip_start con -600
leftknee_start con 240
leftankle_start con 840

gosub movement 

;--------------------------------------------------------------------

movement:

' Add your movement code here


Return ' <-----returns program execution back to where it left off.

Mike, Not exactly. The gosub’s label is movement. It then passes the following values to the movement label.

chronoblip, is this the entire code? If so you have not snipped enough stuff to make it work. Go back to the original program and take care not to remove so much stuff.

I’m not sure where I misunderstand. I have always understood that you have a gosub command using a user defined label and a Return following that. Your saying that you can pass values contained in brackets? If so I did not know this. I’m not much a programmer anyway, so perhaps I can learn from this as well. :laughing:

Yeah that’s it. I think that ability came to be in 8.0.1.0. The label is in the command, but you are correct in that the label is missing in his example, meaning he has apparently cut that part from the original code.