Wyatt
1.0.1
|
#include <AdafruitPWMServoHat.h>
Public Member Functions | |
AdafruitPWMServoHat (int pwmFrequency=60) | |
~AdafruitPWMServoHat () | |
bool | setMotor (int motorID, int speed) |
bool | stopMotor (int motorID) |
bool | stopAllMotors () |
void | setPwm (int channel, int on, int off) |
void | setAllPwm (int on, int off) |
This class controls an Adafruit PWM/Servo Raspberry Pi Hat.
I2C specific functions adapted from: https://github.com/adafruit/Adafruit_Python_PCA9685/blob/master/Adafruit_PCA9685/PCA9685.py
Definition at line 36 of file AdafruitPWMServoHat.h.
AdafruitPWMServoHat::AdafruitPWMServoHat | ( | int | pwmFrequency = 60 | ) |
Constructs an Adafruit PWM/Servo Driver Hat controller. This will also configure the proper I2C communication channels for the device.
pwmFrequency | PWM frequency to set (default is 60) |
Definition at line 7 of file AdafruitPWMServoHat.cpp.
AdafruitPWMServoHat::~AdafruitPWMServoHat | ( | ) |
Destruct the driver object.
Definition at line 23 of file AdafruitPWMServoHat.cpp.
void AdafruitPWMServoHat::setAllPwm | ( | int | on, |
int | off | ||
) |
Set all PWM channels to a specific on/off time.
on | On time |
off | Off time |
Definition at line 81 of file AdafruitPWMServoHat.cpp.
bool AdafruitPWMServoHat::setMotor | ( | int | motorID, |
int | speed | ||
) |
Set a motor or servo on the HAT.
motorID | Motor ID, from 0-15 (mapped to the outputs on the baord. |
speed | The speed (0-4095) to set the motor to. |
Definition at line 27 of file AdafruitPWMServoHat.cpp.
void AdafruitPWMServoHat::setPwm | ( | int | channel, |
int | on, | ||
int | off | ||
) |
Set a PWM channel to a specific on/off time.
channel | Channel to write to. |
on | On time |
off | Off time |
Definition at line 73 of file AdafruitPWMServoHat.cpp.
bool AdafruitPWMServoHat::stopAllMotors | ( | ) |
Stop all motors on the HAT.
Definition at line 40 of file AdafruitPWMServoHat.cpp.
bool AdafruitPWMServoHat::stopMotor | ( | int | motorID | ) |
Stop a specific motor/servo on the HAT.
motorID | Motor ID, from 0-15 (mapped to the outputs on the baord. |
Definition at line 34 of file AdafruitPWMServoHat.cpp.