PropWare
C++ objects and CMake build system for Parallax Propeller
|
#include <pwm32.h>
Public Member Functions | |
void | Start (void) |
void | Stop (void) |
void | Duty (int pin, int duty_cycle, int period) |
void | Servo (int pin, int pulse_width) |
void | PWM (int pin, int on_time, int off_time) |
Static Public Attributes | |
static const int | Resolution = 8200 |
Run up to 32 channels of low speed PWM (up to ~10kHz@80MHz clock).
No external hardware beyond the PWM devices is needed. Works with H bridges, LEDs, servos, and anything else that takes a repeating PWM signal.
Copyright (c) 2013 Kenneth Bedolla (libpr) opel ler@k enne thbed olla .com
void libpropeller::PWM32::Duty | ( | int | pin, |
int | duty_cycle, | ||
int | period | ||
) |
void libpropeller::PWM32::PWM | ( | int | pin, |
int | on_time, | ||
int | off_time | ||
) |
void libpropeller::PWM32::Servo | ( | int | pin, |
int | pulse_width | ||
) |
Output a servo compatible pulse with a period of 20ms.
pin | The I/O pin to use (0..31) |
pulse_width | The width of the servo pulse in uS. Can be any value, but most servos require a range (1000..2000) |
void libpropeller::PWM32::Start | ( | void | ) |
Start a cog with the PWM runner.
Definition at line 44 of file pwm32.h.
void libpropeller::PWM32::Stop | ( | void | ) |