![]() |
MOREbot_Library
1.3.2
Library to control the MOREbot base robot
|
#include <MOREbot.h>
Public Member Functions | |
| motor (int motorPort) | |
| void | counterClockwise (int speed) |
| void | clockwise (int speed) |
| void | stop () |
Motor class. Handles retrieving the motor from i2c and then sending the commands.
| motor::motor | ( | int | motorPort | ) |
Motor constructor. Retrieves the i2c address of the specified motor port on the motor shield.
| motorPort | integer. The motor port being accessed. |
| void motor::clockwise | ( | int | speed | ) |
Clockwise 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.
1.8.15