Basic motor code

Dependencies:   Motordriver mbed HALLFX_ENCODER Servo

main.cpp

Committer:
jsterling30
Date:
2018-04-18
Revision:
1:560118dc2f99
Parent:
0:191d0be60c80
Child:
2:8c27831ce9a2

File content as of revision 1:560118dc2f99:

#include "mbed.h"
#include "motordriver.h"
 
Motor right(p23,p5,p6, 1); // pwm, fwd, rev
Motor left(p21, p7, p8, 1); // pwm, fwd, rev

//void forward(int distance) {
//
//}
//
//void reverse(int distance) {
//
//}
//void turnLeft() {
//
//}

int main() {
    right.speed(0.15);
    left.speed(0.15);
    wait(5);
    right.speed(0.0);
    left.speed(0.0);
}