Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

motor.cpp

Committer:
kyleliangus
Date:
2017-05-05
Revision:
8:a0760acdc59e
Child:
12:5790e56a056f

File content as of revision 8:a0760acdc59e:

#include "mbed.h"
#include "motor.h"

void Motor::backward(double voltage) {
    forw.write(voltage);
    back.write(0);
}

void Motor::forward(double voltage) {
    forw.write(0);
    back.write(voltage);
}


void Motor::brake() {
    forw.write(BRAKE_VOLTAGE);
    back.write(BRAKE_VOLTAGE);
}

void Motor::coast() {
    forw.write(0);
    back.write(0);
}