help this program is sopposed to make the c law close

1 reply [Last post]
ryanneedshelp
Title: NooBot
Joined: 04/11/2012
Posts:
BotPoints: 0
User offline. Last seen 10 years 23 weeks ago.

hello my name is ryan. my bot ball tornament is this saturday. i just need to know how to get the c law to close all the way and just stay like like that.
this program do no make the claw hold on to the ball.

int main ()
{

set_servo_position(0,200);

enable_servos(); // turn on servo

sleep(.1); // pause while it moves

printf("run from the KISS IDE & check values\n");

printf("advance using down arrow\n\nB to quit\n");

// move servo 1 in steps of 100

set_servo_position(0,

get_servo_position(0)+1800);

printf("servo at %d\n", get_servo_position(0));

sleep(.2); // pause before next move

while(!down_button() && !b_button());

{
}
return 0;

}

amehta
Title: NooBot
Joined: 07/18/2011
Posts:
BotPoints: 136
User offline. Last seen 5 years 32 weeks ago.

Well when you use the set_servo_position function, the servo will stay stationary in that position (and hold onto a ball without dropping it) as long as you don't disable_servos. So measure the position that you need to hold on to the ball (use the servo test on the CBC) and put that into your set_servo_position function and you should be good to go.

-amehta (Andrew Mehta)