Hello world program that just gets the m3pi moving

Dependencies:   mbed m3pi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "m3pi.h"
00003 
00004 m3pi m3pi;
00005 
00006 int main() {
00007 
00008     m3pi.locate(0,1);
00009     m3pi.printf("LO World");
00010 
00011     wait (2.0);
00012 
00013     m3pi.forward(0.5); // Forward half speed
00014     wait (0.5);        // wait half a second
00015     m3pi.left(0.5);    // Turn left at half speed
00016     wait (0.5);        // wait half a second
00017     m3pi.backward(0.5);// Backward at half speed 
00018     wait (0.5);        // wait half a second
00019     m3pi.right(0.5);   // Turn right at half speed
00020     wait (0.5);        // wait half a second
00021 
00022     m3pi.stop();       
00023 }