Skip to content

Commit 4096531

Browse files
committed
PWD isn't working, yet
1 parent 19a948d commit 4096531

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

source/examples/python/pwm.old.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Adafruit_BBIO.PWM as PWM
2+
3+
#set polarity to 1 on start:
4+
#PWM.start("P9_14", 50, 2000, 1)
5+
6+
#PWM.start(channel, duty, freq=2000, polarity=0)
7+
#duty values are valid 0 (off) to 100 (on)
8+
9+
PWM.start("P9_14", 50)
10+
PWM.set_duty_cycle("P9_14", 25.5)
11+
PWM.set_frequency("P9_14", 10)
12+
13+
PWM.stop("P9_14")
14+
PWM.cleanup()

source/examples/python/pwm.py

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
import Adafruit_BBIO.PWM as PWM
23

34
#set polarity to 1 on start:
@@ -6,9 +7,10 @@
67
#PWM.start(channel, duty, freq=2000, polarity=0)
78
#duty values are valid 0 (off) to 100 (on)
89

9-
PWM.start("P9_14", 50)
10-
PWM.set_duty_cycle("P9_14", 25.5)
11-
PWM.set_frequency("P9_14", 10)
10+
SERVO="P9_14"
11+
PWM.start(SERVO, 50)
12+
PWM.set_duty_cycle(SERVO, 25.5)
13+
PWM.set_frequency(SERVO, 10)
1214

13-
PWM.stop("P9_14")
15+
PWM.stop(SERVO)
1416
PWM.cleanup()

0 commit comments

Comments
 (0)