os5

Dependencies:   m3pi

Committer:
Georg
Date:
Mon Sep 14 10:19:50 2020 +0000
Revision:
0:ca77b05e6a8e
os5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Georg 0:ca77b05e6a8e 1 #include "mbed.h"
Georg 0:ca77b05e6a8e 2 #include "m3pi.h"
Georg 0:ca77b05e6a8e 3
Georg 0:ca77b05e6a8e 4 m3pi m3pi;
Georg 0:ca77b05e6a8e 5
Georg 0:ca77b05e6a8e 6 int main() {
Georg 0:ca77b05e6a8e 7
Georg 0:ca77b05e6a8e 8 m3pi.locate(0,1);
Georg 0:ca77b05e6a8e 9 m3pi.printf("LO World");
Georg 0:ca77b05e6a8e 10
Georg 0:ca77b05e6a8e 11 wait (2.0);
Georg 0:ca77b05e6a8e 12
Georg 0:ca77b05e6a8e 13 m3pi.forward(0.1); // Forward half speed
Georg 0:ca77b05e6a8e 14 wait (0.5); // wait half a second
Georg 0:ca77b05e6a8e 15 m3pi.left(0.1); // Turn left at half speed
Georg 0:ca77b05e6a8e 16 wait (0.5); // wait half a second
Georg 0:ca77b05e6a8e 17 m3pi.backward(0.1);// Backward at half speed
Georg 0:ca77b05e6a8e 18 wait (0.5); // wait half a second
Georg 0:ca77b05e6a8e 19 m3pi.right(0.1); // Turn right at half speed
Georg 0:ca77b05e6a8e 20 wait (0.5); // wait half a second
Georg 0:ca77b05e6a8e 21
Georg 0:ca77b05e6a8e 22 m3pi.stop();
Georg 0:ca77b05e6a8e 23 }