Skip to content

Setting the duty_factor of the PWM is unreliable #518

Closed
@floitsch

Description

@floitsch
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions