Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
ServoChannel Class Reference

Public Member Functions

 ServoChannel ()
 Instantiate a servo channel object
has to be attached to a pin before using. More...
 
bool attach (uint8 pin)
 attach servo channel to a unused pin More...
 
bool detach ()
 detaches servo channel pin will be set to input More...
 
bool setDegree (int8 value)
 set value in servo degree
input value is mapped between min and max value More...
 
bool setMaxValue (uint32 maxValue=DEFAULTMAXVALUE)
 set max value for output timing More...
 
bool setMinValue (uint32 minValue=DEFAULTMINVALUE)
 set min value for output timing More...
 
uint32 getMaxValue () const
 simple getter More...
 
uint32 getMinValue () const
 simple getter More...
 
uint32 getValue () const
 simple getter More...
 
bool setValue (uint32 value)
 set value for output More...
 
uint8 getPin () const
 simple getter More...
 

Constructor & Destructor Documentation

ServoChannel::ServoChannel ( )

Instantiate a servo channel object
has to be attached to a pin before using.

Member Function Documentation

bool ServoChannel::attach ( uint8  pin)

attach servo channel to a unused pin

Parameters
pinGPIO to use
pin will be set to output
Return values
boolTrue on success
bool ServoChannel::detach ( )

detaches servo channel pin will be set to input

Return values
boolTrue on success
uint32 ServoChannel::getMaxValue ( ) const
inline

simple getter

Return values
uint32max time in us
uint32 ServoChannel::getMinValue ( ) const
inline

simple getter

Return values
uint32min time in us
uint8 ServoChannel::getPin ( ) const
inline

simple getter

Return values
uint8attached pin for this channel
uint32 ServoChannel::getValue ( ) const

simple getter

Return values
uint32actual value in us
bool ServoChannel::setDegree ( int8  value)

set value in servo degree
input value is mapped between min and max value

Parameters
valueis limited between -90 and 90 degrees
Return values
boolTrue on success
bool ServoChannel::setMaxValue ( uint32  maxValue = DEFAULTMAXVALUE)

set max value for output timing

Parameters
valuetime in us for maximum output of this channel
has to be larger than min value
Return values
boolTrue on success
bool ServoChannel::setMinValue ( uint32  minValue = DEFAULTMINVALUE)

set min value for output timing

Parameters
valuetime in us for minimum output of this channel
has to be smaller than max value
Return values
boolTrue on success
bool ServoChannel::setValue ( uint32  value)

set value for output

Parameters
valuetime in us for actual output of this channel
has to be smaller than max-min value
Return values
boolTrue on success