Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

motor.cpp

Committer:
vanshg
Date:
2017-05-06
Revision:
10:810d1849da9d
Parent:
8:a0760acdc59e
Child:
12:5790e56a056f

File content as of revision 10:810d1849da9d:

#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);
}