Search Code
About m3pi_HelloWorld

First published 29 Oct 2010, with 8 revisions since.
Last update: 10 Nov 2010.
View history

Last change message: Fixed typo

Related to
m3pi
tag m3pi, robot

Import this program

m3pi_HelloWorld

Published 10 Nov 2010, by   user Chris Styles   tag 3pi, m3pi, pololu
Embed: (wiki syntax)

« Back to documentation index

You are viewing an out of date revision of m3pi_HelloWorld! View latest revision

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "m3pi.h"
00003 
00004 m3pi m3pi(p23,p9,p10);
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);        // For half a second
00015     m3pi.left(0.5);
00016     wait (0.5);
00017     m3pi.backward(0.5);
00018     wait (0.5);
00019     m3pi.right(0.5);
00020     wait (0.5);
00021 
00022     m3pi.stop();
00023 
00024 }