Private
Public Access
2
0

pwm: Fully Functional.

* C++ example included

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-04-14 16:55:19 +01:00
parent 5c2235dc0c
commit fbd863ca39
3 changed files with 32 additions and 5 deletions

24
examples/cycle-pwm3.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include <unistd.h>
#include "maa.h"
int
main ()
{
maa::PWM pwm(0, 3);
pwm.period_us(200);
pwm.enable(1);
float value = 0.0f;
while(1) {
value = value + 0.01f;
pwm.write(value);
usleep(50000);
if (value >= 1.0f) {
value = 0.0f;
}
float output = pwm.read();
}
return 0;
}