IT GOES NORTH MOST OF THE TIME

Dependencies:   HMC6352 Motor mbed

main.cpp

Committer:
vsavkin3
Date:
2012-10-02
Revision:
0:1a0fa585e36c
Child:
1:6812f830e5a1

File content as of revision 0:1a0fa585e36c:

#include "mbed.h"
#include "Motor.h"

Motor right(p21, p23, p22); // pwm, fwd, rev
Motor left(p26, p24, p25); // pwm, fwd, rev

int main() {
    while (1){
        for (float s= -1.0; s < 1.0 ; s += 0.01) {
           right.speed(s); 
           left.speed(s);
           wait(0.02);
        }        
        for (float s= 1.0; s > -1.0 ; s -= 0.01) {
           right.speed(s); 
           left.speed(s);
           wait(0.02);
        }
    }
}