PWM Class Reference
#include <lpc_pwm.hpp>
Public Types | |
enum | pwmType { pwm1 =0, pwm2 =1, pwm3 =2, pwm4 =3, pwm5 =4, pwm6 =5 } |
Public Member Functions | |
PWM (pwmType pwm, unsigned int frequencyHz=50) | |
~PWM () | |
Destructor that will destroy PWM configuration. More... | |
bool | set (float percent) |
Detailed Description
Member Enumeration Documentation
enum PWM::pwmType |
Constructor & Destructor Documentation
PWM::PWM | ( | pwmType | pwm, |
unsigned int | frequencyHz = 50 |
||
) |
PWM::~PWM | ( | ) |
Destructor that will destroy PWM configuration.
Member Function Documentation
bool PWM::set | ( | float | percent | ) |
Sets the PWM based on the percentage. If 50Hz Servo PWM was setup, then you can use the following :
- Left : set(5.0); // 5.0 % of 20ms = 1.0ms
- Neutral : set(7.5); // 7.5 % of 20ms = 1.5ms
- Right : set(10.0); // 10 % of 20ms = 2.0ms
You can use micro-steps to position the servo motor by using set(5.1), set(5.2) ... set(7.4) etc.
The documentation for this class was generated from the following files:
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/lpc_pwm.hpp
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/src/lpc_pwm.cpp