Class that stores state and functions for seesaw servo interface.
More...
#include <seesaw_servo.h>
Class that stores state and functions for seesaw servo interface.
◆ seesaw_Servo()
class constructor
- Parameters
-
ss | the seesaw object to use |
◆ begin()
bool seesaw_Servo::begin |
( |
uint8_t |
addr = SEESAW_ADDRESS , |
|
|
int8_t |
flow = -1 |
|
) |
| |
begin the seesaw. This is only necessary if the seesaw is not already started
- Parameters
-
addr | the address to begin on |
flow | the flow control pin to use |
- Returns
- true on success, false otherwise
◆ attach() [1/2]
uint8_t seesaw_Servo::attach |
( |
int |
pin | ) |
|
attach the given pin to the next free channel, sets pinMode.
- Parameters
-
- Returns
- 0
◆ attach() [2/2]
uint8_t seesaw_Servo::attach |
( |
int |
pin, |
|
|
int |
min, |
|
|
int |
max |
|
) |
| |
attach the given pin to the next free channel but also sets min and max values for writes.
- Parameters
-
pin | the pin to use |
min | the minimum pulse width value in microseconds |
max | the maximum pulse width value in microseconds |
- Returns
- 0
◆ write()
void seesaw_Servo::write |
( |
int |
value | ) |
|
write a value. if value is < 200 its treated as an angle, otherwise as pulse width in microseconds
- Parameters
-
◆ writeMicroseconds()
void seesaw_Servo::writeMicroseconds |
( |
int |
value | ) |
|
Write pulse width in microseconds.
- Parameters
-
◆ read()
int seesaw_Servo::read |
( |
void |
| ) |
|
get current value
- Returns
- current pulse width as an angle between 0 and 180 degrees
◆ readMicroseconds()
int seesaw_Servo::readMicroseconds |
( |
| ) |
|
|
inline |
get current value in microseconds
- Returns
- current pulse width in microseconds for this servo
◆ attached()
bool seesaw_Servo::attached |
( |
| ) |
|
|
inline |
check if the servo is attached yet
- Returns
- true if this servo is attached, otherwise false
The documentation for this class was generated from the following files: