Pico-Arduino
Public Member Functions | List of all members
Servo Class Reference

We provide an alternative Pico implementation for the Servo class which is compatible with the Arduino Servo library. More...

#include <PicoPWMServo.h>

Public Member Functions

void attach (int pin)
 attach the given pin to the next free channel, sets pinMode, returns channel number or 0 if failure
 
void attach (int pin, int min, int max)
 as above but also sets min and max values for writes.
 
void detach ()
 stops the generation of signals
 
void write (int value)
 if value is < 200 its treated as an angle, otherwise as pulse width in microseconds

 
void writeMicroseconds (int value)
 Write pulse width in microseconds.
 
int read ()
 returns current pulse width as an angle between 0 and 180 degrees
 
int readMicroseconds ()
 returns current pulse width in microseconds for this servo (was read_us() in first release)
 
bool attached ()
 return true if this servo is attached, otherwise false
 

Detailed Description

We provide an alternative Pico implementation for the Servo class which is compatible with the Arduino Servo library.


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