#include <SoftwarePWM.h>
Public Member Functions | |
void | Disable () |
void | Enable (int StartPos, int Period) |
void | SetPosition (int NewPos) |
SoftwarePWM (PinName Pin) | |
Private Member Functions | |
void | EndPulse () |
void | StartPulse () |
Private Attributes | |
int | Position |
Ticker | Pulse |
Timeout | PulseStop |
DigitalOut | SoftwarePWMPin |
Class to control a servo on any pin, without using pwm
Example:
Definition at line 55 of file SoftwarePWM.h.
SoftwarePWM::SoftwarePWM | ( | PinName | Pin | ) |
Create a new SoftwarePWM object on any mbed pin
Pin | Pin on mbed to connect PWM device to |
Definition at line 4 of file SoftwarePWM.cpp.
void SoftwarePWM::Disable | ( | ) |
Disable the PWM. After disabling the PWM won't get any signal anymore
Definition at line 35 of file SoftwarePWM.cpp.
void SoftwarePWM::Enable | ( | int | StartPos, |
int | Period | ||
) |
Enable the PWM. Without enabling the PWM won't be running. Startposition and period both in us.
StartPos | The position of the PWM to start (us) |
Period | The time between every pulse. 20000 us = 50 Hz(standard) (us) |
Definition at line 29 of file SoftwarePWM.cpp.
|
private |
Definition at line 24 of file SoftwarePWM.cpp.
void SoftwarePWM::SetPosition | ( | int | NewPos | ) |
Change the position of the PWM. Position in us
NewPos | The new value of the PWM position (us) |
Definition at line 6 of file SoftwarePWM.cpp.
|
private |
Definition at line 11 of file SoftwarePWM.cpp.
|
private |
Definition at line 87 of file SoftwarePWM.h.
|
private |
Definition at line 89 of file SoftwarePWM.h.
|
private |
Definition at line 90 of file SoftwarePWM.h.
|
private |
Definition at line 88 of file SoftwarePWM.h.