Mouse code for the MacroRat
motor.cpp
- Committer:
- vanshg
- Date:
- 2017-05-07
- Revision:
- 11:8fc2b703086b
- Parent:
- 8:a0760acdc59e
- Child:
- 12:5790e56a056f
File content as of revision 11:8fc2b703086b:
#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); }