Team Lumberjack
/
m3pi_HelloWorld
Mircroprocessor revised code 9/22
Fork of m3pi_HelloWorld by
Revision 9:b723c1cdaae4, committed 2014-09-22
- Comitter:
- SpicedPork
- Date:
- Mon Sep 22 19:28:33 2014 +0000
- Parent:
- 8:abc27ba9f8f3
- Commit message:
- MICROPROCESSOR FINAL 9/22
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r abc27ba9f8f3 -r b723c1cdaae4 main.cpp --- a/main.cpp Thu Sep 18 18:55:58 2014 +0000 +++ b/main.cpp Mon Sep 22 19:28:33 2014 +0000 @@ -1,30 +1,51 @@ - #include "mbed.h" - #include "m3pi.h" +#include "mbed.h" +#include "m3pi.h" + +m3pi m3pi; + +DigitalOut myled(LED1); + + +int main() { - m3pi m3pi; + + m3pi.locate(0,1); + m3pi.printf("START"); + + m3pi.right_motor(-0.246); + m3pi.left_motor(0.246); + wait(0.260); - Timer stopwatch; - DigitalOut myled(LED1); + m3pi.forward(0.241); + wait(1.00); + + m3pi.right_motor(0.093); + m3pi.left_motor(0.1825); + wait(1.220); + + m3pi.forward(0.241); + wait(4.500); - int main(){ - - int oldtime=0; + m3pi.right_motor(0.093); + m3pi.left_motor(0.1825); + wait(1.220); - m3pi.stop(); + m3pi.forward(0.482); + wait(1.000); + m3pi.stop(); + + while(1) + { m3pi.locate(0,1); - m3pi.printf("butts"); - - stopwatch.reset(); - stopwatch.start(); + m3pi.printf("FARTS"); - while (1) { - m3pi.locate(0,0); - m3pi.printf("%i",stopwatch.read_ms()); - if (stopwatch,read_ms()-oldtime>1000) { - myled=!myled; - oldtime=stopwatch.read_ms(); - - } - } - } \ No newline at end of file + myled = 1; + wait(0.500); + myled = 0; + wait(0.500); + } + +} + + \ No newline at end of file