EMBER 0.1
EMBER is a fire suppression system with a thermal IR camera for hot blob detection on a pan/tilt mechanism with a solenoid for commanded water flow.
Loading...
Searching...
No Matches
DRV8871Driver Class Reference

A class to add basic functions for DRV8871 Motor Driver. More...

#include <DRV8871Driver.h>

Public Member Functions

 DRV8871Driver (uint8_t in1, uint8_t in2)
 Constructor function which initializes the motor driver.
void driveMotor (uint8_t speed, bool dir)
 Function which drives the motor at a specified speed and direction.
void coastMotor (void)
 Coast motor to stop - lets the motor spin down by itself.
void brakeMotor (void)
 Brake the motor Quickly - uses active braking to stop the motor.

Protected Attributes

uint8_t in1Pin
uint8_t in2Pin

Detailed Description

A class to add basic functions for DRV8871 Motor Driver.

This class enables drive, coast, and brake functions for a DRV8871 motor driver. It uses PWM for speed control and a digital pin for direction control. This class uses 8 bit PWM resolution, so speed values should be integers from 0 to 255.

Template Parameters
in1PWM output pin (uses analogWrite)
in2Direction pin (uses digitalWrite)

Constructor & Destructor Documentation

◆ DRV8871Driver()

DRV8871Driver::DRV8871Driver ( uint8_t in1,
uint8_t in2 )

Constructor function which initializes the motor driver.

Parameters
in1PWM output pin
in2Direction pin

Member Function Documentation

◆ driveMotor()

void DRV8871Driver::driveMotor ( uint8_t speed,
bool dir )

Function which drives the motor at a specified speed and direction.

Parameters
speedunsigned speed value. Range: 0 to max based on resolution
dirDirection (true/false) written to the direction pin

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