First import from throwbot
Diff: motors.cpp
- Revision:
- 0:5b2bf6e79b07
- Child:
- 1:201d986498c7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/motors.cpp Thu May 08 19:11:31 2014 +0000 @@ -0,0 +1,17 @@ +#include "motors.h" + +Motors::Motors(TB6612 * L, TB6612 * R, PinName STBY): + Left(L), Right(R), enable(STBY) +{ + enable = 1; +} + +void Motors::flip() +{ + TB6612 * temp = Left; + Left = Right; + Right = temp; + + Left->scale *= -1; + Right->scale *= -1; +} \ No newline at end of file