Adafruit Motor Shield V2 Arduino Library
Public Member Functions | Friends | List of all members
Adafruit_DCMotor Class Reference

#include <Adafruit_MotorShield.h>

Public Member Functions

 Adafruit_DCMotor (void)
 Create a DCMotor object, un-initialized! You should never call this, instead have the Adafruit_MotorShield give you a DCMotor object with Adafruit_MotorShield.getMotor.
 
void run (uint8_t)
 Control the DC Motor direction and action. More...
 
void setSpeed (uint8_t)
 Control the DC Motor speed/throttle. More...
 
void setSpeedFine (uint16_t speed)
 Control the DC Motor speed/throttle with 12 bit resolution. More...
 
void fullOn ()
 Set DC motor to full on.
 
void fullOff ()
 Set DC motor to full off.
 

Friends

class Adafruit_MotorShield
 Let MotorShield create DCMotors.
 

Detailed Description

Object that controls and keeps state for a single DC motor

Member Function Documentation

◆ run()

void Adafruit_DCMotor::run ( uint8_t  cmd)

Control the DC Motor direction and action.

Parameters
cmdThe action to perform, can be FORWARD, BACKWARD or RELEASE

◆ setSpeed()

void Adafruit_DCMotor::setSpeed ( uint8_t  speed)

Control the DC Motor speed/throttle.

Parameters
speedThe 8-bit PWM value, 0 is off, 255 is on

◆ setSpeedFine()

void Adafruit_DCMotor::setSpeedFine ( uint16_t  speed)

Control the DC Motor speed/throttle with 12 bit resolution.

Parameters
speedThe 12-bit PWM value, 0 (full off) to 4095 (full on)

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