Mircroprocessor revised code 9/22

Dependencies:   m3pi mbed

Fork of m3pi_HelloWorld by Chris Styles

main.cpp

Committer:
SpicedPork
Date:
2014-09-18
Revision:
8:abc27ba9f8f3
Parent:
7:d0689e8f23bf
Child:
9:b723c1cdaae4

File content as of revision 8:abc27ba9f8f3:

    #include "mbed.h"
    #include "m3pi.h"
    
    m3pi m3pi;
    
    Timer stopwatch;
    DigitalOut myled(LED1);
    
    int main(){
        
        int oldtime=0;
    
        m3pi.stop();
    
        m3pi.locate(0,1);
        m3pi.printf("butts");
    
        stopwatch.reset();
        stopwatch.start();
    
        while (1) {
         m3pi.locate(0,0);
         m3pi.printf("%i",stopwatch.read_ms());
         if (stopwatch,read_ms()-oldtime>1000) {
             myled=!myled;
             oldtime=stopwatch.read_ms();
             
             }
        }
    }