LED.h & Umwandeln.h

Dependencies:   m3pi_ng mbed

TEST.h

Committer:
spolak
Date:
2017-01-11
Revision:
0:d453d7554981

File content as of revision 0:d453d7554981:

// Drive the m3pi forward, turn left, back, turn right, at half speed for half a second

  #include "mbed.h"
  #include "m3pi_ng.h"

  m3pi pi;

  int main() {

    wait(0.5);
    pi.right_motor(0.5);
    pi.left_motor(0.2);
    wait(0.5);
    pi.left_motor(0.5);
    pi.right_motor(0.2);
    wait(0.5);
  
    pi.stop();
    wait(0.5);
      
    int i=1, n=0;
    while(n!=8)
    {
        pi.leds(i);
        wait(0.2);
        i=i*2;
        n++;
    }
    
    wait(1);

    i=1, n=0;
    while(n!=8)
    {
        pi.leds(i);
        wait(0.2);
        i=i*2;
        n++;
    }

    pi.stop();
    wait(0.5);
    
    pi.right_motor(-0.5);
    pi.left_motor(-0.2);
    wait(0.5);
    pi.left_motor(-0.5);
    pi.right_motor(-0.2);
    wait(0.5);
    
    
    pi.stop();

}