Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the duty_factor of the PWM is unreliable #518

Closed
floitsch opened this issue Feb 25, 2022 · 2 comments
Closed

Setting the duty_factor of the PWM is unreliable #518

floitsch opened this issue Feb 25, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@floitsch
Copy link
Member

floitsch commented Feb 25, 2022

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.

@floitsch floitsch added the bug Something isn't working label Feb 25, 2022
@floitsch
Copy link
Member Author

floitsch commented Mar 4, 2022

@floitsch
Copy link
Member Author

floitsch commented Jul 8, 2022

This has been solved by updating the esp-idf.

@floitsch floitsch closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant