|
mraa
0.9.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
This file defines the PWM interface for libmraa
Public Member Functions | |
| synchronized void | delete () |
| Pwm (int pin, boolean owner, int chipid) | |
| Pwm (int pin, boolean owner) | |
| Pwm (int pin) | |
| Result | write (float percentage) |
| float | read () |
| Result | period (float period) |
| Result | period_ms (int ms) |
| Result | period_us (int us) |
| Result | pulsewidth (float seconds) |
| Result | pulsewidth_ms (int ms) |
| Result | pulsewidth_us (int us) |
| Result | enable (boolean enable) |
| Result | config_ms (int period, float duty) |
| Result | config_percent (int period, float duty) |
| int | max_period () |
| int | min_period () |
| Pwm | ( | int | pin, |
| boolean | owner, | ||
| int | chipid | ||
| ) |
instanciates a PWM object on a pin
| pin | the pin number used on your board |
| owner | if you are the owner of the pin the destructor will |
| chipid | the pwmchip to use, use only in raw mode unexport the pin from sysfs, default behaviour is you are the owner if the pinmapper exported it |
| Result config_ms | ( | int | period, |
| float | duty | ||
| ) |
Set the period and duty of a PWM object.
| period | represented in ms. |
| duty | represnted in ms as float. |
| Result config_percent | ( | int | period, |
| float | duty | ||
| ) |
Set the period and duty (percent) of a PWM object.
| period | as represented in ms. |
| duty | percentage i.e. 50% = 0.5f |
| Result enable | ( | boolean | enable | ) |
Set the enable status of the PWM pin. None zero will assume on with output being driven and 0 will disable the output
| enable | enable status of pin |
| int max_period | ( | ) |
Get the maximum pwm period in us
| int min_period | ( | ) |
Get the minimum pwm period in us
| Result period | ( | float | period | ) |
Set the PWM period as seconds represented in a float
| period | Period represented as a float in seconds |
| Result period_ms | ( | int | ms | ) |
| Result period_us | ( | int | us | ) |
| Result pulsewidth | ( | float | seconds | ) |
Set pulsewidth, As represnted by seconds in a (float)
| seconds | The duration of a pulse |
| Result pulsewidth_ms | ( | int | ms | ) |
| Result pulsewidth_us | ( | int | us | ) |
| float read | ( | ) |
Read the ouput duty-cycle percentage, as a float
| Result write | ( | float | percentage | ) |
Set the output duty-cycle percentage, as a float
| percentage | A floating-point value representing percentage of output. The value should lie between 0.0f (representing on 0%) and 1.0f Values above or below this range will be set at either 0.0f or 1.0f |
1.8.9.1