Closed
Description
import gpio
import gpio.pwm
main:
led := gpio.Pin 5
generator := pwm.Pwm --frequency=400
channel2 := generator.start (gpio.Pin 12)
channel3 := generator.start (gpio.Pin 13)
channel4 := generator.start (gpio.Pin 14)
channel5 := generator.start (gpio.Pin 15)
x := 50
[ channel2, channel3, channel4, channel5 ].do:
it.set_duty_factor (x/100.0)
x += 10
The setting of the duty_factor is unreliable.
Things get much more stable, if there is a sleep --ms=10
between the start
and the set_duty_factor
.