![]() |
MOREbot Library
v1.1.1
|
Motor class. More...
#include <MOREbot.h>
Public Member Functions | |
motor (int MX) | |
Motor constructor. More... | |
void | counterClockwise (int speed) |
counterClockwise motor function. More... | |
void | clockwise (int speed) |
Backward motor function. More... | |
void | stop () |
Stop motor function. More... | |
Motor class.
Handles retrieving the motor from i2c and then sending the commands.
motor::motor | ( | int | MX | ) |
Motor constructor.
Retrieves the i2c address of the specified motor port on the motor shield.
MX | integer. The motor port being accessed. |
void motor::clockwise | ( | int | speed | ) |
Backward motor function.
Sets motor speed and direction (of the internal motor axle), handles negative values with counterClockwise().
speed | an integer. The speed to be sent to the motor. Contrained from -100 to 100. |
void motor::counterClockwise | ( | int | speed | ) |
counterClockwise motor function.
Sets motor speed and direction (of the internal motor axle), handles negative values with clockwise().
speed | an integer. The speed to be sent to the motor. Contrained from -100 to 100. |
void motor::stop | ( | ) |
Stop motor function.
Sets motor speed to zero, and releases the motor.