MOREbot Library  v1.1.1
Public Member Functions | List of all members
motor Class Reference

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...
 

Detailed Description

Motor class.

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

Constructor & Destructor Documentation

◆ motor()

motor::motor ( int  MX)

Motor constructor.

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

Parameters
MXinteger. The motor port being accessed.

Member Function Documentation

◆ clockwise()

void motor::clockwise ( int  speed)

Backward 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: