Example to move the robot.

Dependencies:   m3pi mbed

Fork of 3pi_Line_Follow by Craig Evans

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers code.cpp Source File

code.cpp

00001 #include "main.h"
00002 
00003 // code in here runs again and again
00004 void repeat()
00005 {
00006     // move both motors at 25% speed, the robot should move forwards
00007     robot.left_motor(0.25);
00008     robot.right_motor(0.25);
00009 
00010     // carry on going forward for 2 seconds
00011     wait(2.0);
00012 
00013     // make robot spin right (clock-wise)
00014     robot.left_motor(0.25);
00015     robot.right_motor(-0.25);
00016     
00017     // you can change this value to tune the turning angle
00018     wait(0.5);
00019 
00020 }