– Turning

turning bot Your robot will turn when one side moves faster than the other side, and it will turn toward the side that moves slowest. This includes sides moving backwards. (What?!) When only one side moves its called a pivot, like a move in Basketball. So here’s a tiny program for making your robot turn in place (called ‘spin‘) to the right (clockwise) for 2 seconds.

int main()

{

motor(0,-100);

motor(3,100);

msleep(2000);

ao();

}

This tells the left motor (on port 3) to run at full (100%) power: motor(3,100) and the right motor (on port 0) to run backwards ( ) at full (100%) power: motor(0,-100), then wait for 2 seconds: msleep(2000) before turning all the motors off: ao() It should look like the video below. http://www.youtube.com/watch?v=45uZ-PxkVLI

Problems? Click here.

NEXT: Fine Motor Control.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s