PicoLowLevel
Loading...
Searching...
No Matches
Motor Class Reference

Motor class used to control simple DC motors. More...

#include <Motor.h>

Public Member Functions

 Motor (byte pwm, byte dir, bool invert=false)
 Create object and set motor pins.
 
void begin ()
 Initialize motors.
 
void write (int value)
 Sets the motor speed.
 

Detailed Description

Motor class used to control simple DC motors.

Constructor & Destructor Documentation

◆ Motor()

Motor::Motor ( byte  pwm,
byte  dir,
bool  invert = false 
)

Create object and set motor pins.

Parameters
pwmPWM pin.
dirDirection pin.
invertInvert motor direction, usuful when motors are mounted opposite to one another.

Member Function Documentation

◆ begin()

void Motor::begin ( )

Initialize motors.

Here is the caller graph for this function:

◆ write()

void Motor::write ( int  value)

Sets the motor speed.

Parameters
valueSpeed of the motor, ranging from 0 to maximum PWM value.
Here is the caller graph for this function:

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