pwm: Added python example script
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
16
examples/python/cycle-pwm3.py
Normal file
16
examples/python/cycle-pwm3.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/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
|
||||||
Reference in New Issue
Block a user