Example to move the robot.

Dependencies:   m3pi mbed

Fork of 3pi_Line_Follow by Craig Evans

code.cpp

Committer:
eencae
Date:
2018-03-22
Revision:
2:ec75506e96a3
Parent:
1:d8c15d5b8eac

File content as of revision 2:ec75506e96a3:

#include "main.h"

// code in here runs again and again
void repeat()
{
    // move both motors at 25% speed, the robot should move forwards
    robot.left_motor(0.25);
    robot.right_motor(0.25);

    // carry on going forward for 2 seconds
    wait(2.0);

    // make robot spin right (clock-wise)
    robot.left_motor(0.25);
    robot.right_motor(-0.25);
    
    // you can change this value to tune the turning angle
    wait(0.5);

}