cycle-pwm3.py: make example use real pin3 and make work on gen2
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -25,14 +25,14 @@
|
||||
import mraa
|
||||
import time
|
||||
|
||||
x = mraa.Pwm(0,3)
|
||||
x.period_us(20)
|
||||
x.enable(1)
|
||||
x = mraa.Pwm(3)
|
||||
x.period_us(700)
|
||||
x.enable(True)
|
||||
value= 0.0
|
||||
|
||||
while True:
|
||||
x.write(value)
|
||||
time.sleep(0.2)
|
||||
value = value +0.01
|
||||
time.sleep(0.05)
|
||||
value = value + 0.01
|
||||
if value >= 1:
|
||||
value = 0.0
|
||||
|
||||
Reference in New Issue
Block a user