Private
Public Access
2
0
Files
mraa/examples/python/cycle-pwm3.py
Thomas Ingleby 2d074c2ca3 pwm: Added python example script
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-04-14 17:07:24 +01:00

17 lines
229 B
Python

#!/usr/bin/env python3
import pymaa as maa
import time
x = maa.PWM(0,3)
x.enable(1);
x.period_us(20)
value= 0.0
while True:
x.write(value)
time.sleep(0.2)
value = value +0.01
if value >= 1:
value = 0.0