wpi-32u4-library
|
A servo class to control a servo on pin 5. More...
#include <servo32u4.h>
Inherits Servo32U4Base.
Public Member Functions | |
void | attach (void) |
void | detach (void) |
void | writeMicroseconds (uint16_t microseconds) |
![]() | |
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) |
Additional Inherited Members | |
![]() | |
uint16_t | usMin = 1000 |
uint16_t | usMax = 2000 |
uint8_t | feedbackPin = -1 |
bool | isAttached = false |
A servo class to control a servo on pin 5.
Servo32U4 uses output compare on Timer3 to control the pulse to the servo. The 16-bit Timer3 is set up with a pre-scaler of 8, TOP of 39999 + 1 => 20 ms interval.
OCR3A controls the pulse on pin 5 – this servo must be on pin 5!
Defaults to a range of 1000 - 2000 us, but can be customized.
Definition at line 67 of file servo32u4.h.
|
virtual |
Implements Servo32U4Base.
Definition at line 14 of file servo32u4.cpp.
References Servo32U4Base::isAttached.
Referenced by handleKeyPress(), setup(), and writeMicroseconds().
|
virtual |
Implements Servo32U4Base.
Definition at line 31 of file servo32u4.cpp.
References Servo32U4Base::isAttached.
Referenced by idle().
|
virtual |
Implements Servo32U4Base.
Definition at line 42 of file servo32u4.cpp.
References attach(), Servo32U4Base::isAttached, Servo32U4Base::usMax, and Servo32U4Base::usMin.
Referenced by adjustServos().