Create turns

1 reply [Last post]
aqua
Title: NooBot
Joined: 02/16/2017
Posts:
BotPoints: 3
User offline. Last seen 17 weeks 5 days ago.

We've used a code posted somewhere else on this forum to get the create to turn a specific angle. Unfortunately, the create doesn't seem to be responding to the 'if' statements as it just sits there and spins... when we used our own code, the angle reading still wasn't working... to get it to go 90 degrees we needed to use 24 in the get_create_angle code. The code we borrowed that caused it to just spin is as follows:

Any help will be greatly appreciated!

int CreateTurn(int Speed, int Angle)
{
set_create_normalized_angle(0);

create_spin_CCW(Speed);

if(Speed>0)
{
while(get_create_normalized_angle(0.0) <=Angle)
{
msleep(5);
printf("%d\n", get_create_normalized_angle(0.0));
}

}

else if(Speed<0)
{
while(get_create_normalized_angle(0.0) >=Angle)
{
msleep(5);
printf("%d\n", get_create_normalized_angle(0.0));
}
}

create_stop();
}

Lincolin_Middle...
Title: NooBot
Joined: 03/09/2017
Posts:
BotPoints: 2
User offline. Last seen 15 weeks 2 days ago.

Our Create robot is also going in circles or a straight line. If you have any ideas what the HECK is going on please tell me!!!!!!!!!!!!!