MOREbot_Library  1.3.2
Library to control the MOREbot base robot
Public Member Functions | List of all members
motor Class Reference

#include <MOREbot.h>

Public Member Functions

 motor (int motorPort)
 
void counterClockwise (int speed)
 
void clockwise (int speed)
 
void stop ()
 

Detailed Description

Motor class. Handles retrieving the motor from i2c and then sending the commands.

Constructor & Destructor Documentation

◆ motor()

motor::motor ( int  motorPort)

Motor constructor. Retrieves the i2c address of the specified motor port on the motor shield.

Parameters
motorPortinteger. The motor port being accessed.

Member Function Documentation

◆ clockwise()

void motor::clockwise ( int  speed)

Clockwise motor function. Sets motor speed and direction (of the internal motor axle), handles negative values with counterClockwise().

Parameters
speedan integer. The speed to be sent to the motor. Contrained from -100 to 100.
See also
forward()

◆ counterClockwise()

void motor::counterClockwise ( int  speed)

Counterclockwise motor function. Sets motor speed and direction (of the internal motor axle), handles negative values with clockwise().

Parameters
speedan integer. The speed to be sent to the motor. Contrained from -100 to 100.
See also
backward()

◆ stop()

void motor::stop ( )

Stop motor function. Sets motor speed to zero, and releases the motor.


The documentation for this class was generated from the following files: