50Hz PWM output More...
#include <servo50hz.h>
Public Member Functions | |
| Servo50Hz () | |
| virtual void | ParamChanged (Socket *param) |
| A parameter has changed. | |
| virtual void | Init () |
| perform your initialization here | |
| virtual void | Loop (const unsigned long &interval) |
| The module's main loop. | |
50Hz PWM output
Uses software based PWM. This can use any pin.
Sockets exposed:
Servo.n This is the output in the range -1 to +1. N denotes the servo number. If you define two fast servos then you will get FastServo.0 and FastServo.1.
Servo.n.Min Minimum pulse width to output in us (normally 1000)
Servo.n.Max Maximum pulse width to output in us (normally 2000)
Servo.n.Gain Scale factor. Use 500 for full range pulse width output
Servo.n.Offset Zero offset in us. Use 1500 for normal -1 to +1 servo range
For a throttle output use a gain of 1000 and a zero offset of 1000
external sockets expected: None
| Servo50Hz::Servo50Hz | ( | ) | [inline] |
| virtual void Servo50Hz::Init | ( | ) | [inline, virtual] |
perform your initialization here
This includes connecting plugs and general initialization
Reimplemented from Module.
| virtual void Servo50Hz::Loop | ( | const unsigned long & | interval | ) | [inline, virtual] |
The module's main loop.
This function is called at the rate specified by SetInterval()
Do most of your work here. Try to keep this code fast
Reimplemented from Module.
| virtual void Servo50Hz::ParamChanged | ( | Socket * | param | ) | [inline, virtual] |
A parameter has changed.
Called when a parameter has been changed (read from EEPROM or via the comms link)
param points to the parameter that has changed.
Reimplemented from Module.
1.7.0