Initial Commit

motors.cpp

Committer:
Throwbot
Date:
2014-05-08
Revision:
0:5b2bf6e79b07
Child:
1:201d986498c7

File content as of revision 0:5b2bf6e79b07:

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