wpi-32u4-library
Public Member Functions | Protected Attributes
Servo32U4Base Class Referenceabstract

Base class class for servos. More...

#include <servo32u4.h>

Inherited by Servo32U4Pin12, Servo32U4Pin13, Servo32U4Pin5, and Servo32U4Pin6.

Public Member Functions

virtual void attach (void)=0
 
virtual void detach (void)=0
 
virtual void writeMicroseconds (uint16_t microseconds)=0
 
uint16_t setMinMaxMicroseconds (uint16_t min, uint16_t max)
 

Protected Attributes

uint16_t usMin = 1000
 
uint16_t usMax = 2000
 
uint8_t feedbackPin = -1
 
bool isAttached = false
 

Detailed Description

Base class class for servos.

Each derived class controls a specific pin (obvious from the name).

Legacy Servo32U4 is #defined for pin 5, which is how it was used previously.

Defaults to a range of 1000 - 2000 us, but can be customized.

Definition at line 39 of file servo32u4.h.

Member Function Documentation

◆ attach()

virtual void Servo32U4Base::attach ( void  )
pure virtual

◆ detach()

virtual void Servo32U4Base::detach ( void  )
pure virtual

◆ setMinMaxMicroseconds()

uint16_t Servo32U4Base::setMinMaxMicroseconds ( uint16_t  min,
uint16_t  max 
)

Definition at line 3 of file servo32u4.cpp.

References usMax, and usMin.

◆ writeMicroseconds()

virtual void Servo32U4Base::writeMicroseconds ( uint16_t  microseconds)
pure virtual

Field Documentation

◆ feedbackPin

uint8_t Servo32U4Base::feedbackPin = -1
protected

Definition at line 45 of file servo32u4.h.

◆ isAttached

bool Servo32U4Base::isAttached = false
protected

◆ usMax

uint16_t Servo32U4Base::usMax = 2000
protected

◆ usMin

uint16_t Servo32U4Base::usMin = 1000
protected

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