Adafruit Library
Public Member Functions | List of all members
seesaw_Servo Class Reference

Class that stores state and functions for seesaw servo interface. More...

#include <seesaw_servo.h>

Public Member Functions

 seesaw_Servo (Adafruit_seesaw *ss)
 class constructor More...
 
bool begin (uint8_t addr=SEESAW_ADDRESS, int8_t flow=-1)
 begin the seesaw. This is only necessary if the seesaw is not already started More...
 
uint8_t attach (int pin)
 attach the given pin to the next free channel, sets pinMode. More...
 
uint8_t 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. More...
 
void detach ()
 set attached to false
 
void write (int value)
 write a value. if value is < 200 its treated as an angle, otherwise as pulse width in microseconds More...
 
void writeMicroseconds (int value)
 Write pulse width in microseconds. More...
 
int read ()
 get current value More...
 
int readMicroseconds ()
 get current value in microseconds More...
 
bool attached ()
 check if the servo is attached yet More...
 

Detailed Description

Class that stores state and functions for seesaw servo interface.

Constructor & Destructor Documentation

◆ seesaw_Servo()

seesaw_Servo::seesaw_Servo ( Adafruit_seesaw ss)
inline

class constructor

Parameters
ssthe seesaw object to use

Member Function Documentation

◆ 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
addrthe address to begin on
flowthe 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
pinthe pin to use
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
pinthe pin to use
minthe minimum pulse width value in microseconds
maxthe 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
valuethe value to write

◆ writeMicroseconds()

void seesaw_Servo::writeMicroseconds ( int  value)

Write pulse width in microseconds.

Parameters
valuethe value to write

◆ 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: