Skip to content

PWM behavior has changed #13600

Description

@ThHupk

PWM frequency now defaults to 0. Used to be 1907. Programs now are obliged to set the frequency.

from machine import PWM
led = PWM('LED')
led.freq()
0

Activity

  1. ricksorensen commented on Feb 5, 2024

    @ricksorensen
    Contributor

    See now closed pull request #10850. PWM behavior has been update to be more consistent between ports. I believe the default behavior is to not start PWM if freq/duty not specified.
    #10850 (comment)

  2. robert-hh commented on Feb 5, 2024

    @robert-hh
    Contributor

    The only port which was not yet aligned is the ESP32 port. There is an open PR #10854 aligning most of the behavior. Only with this port PWM starts at a default frequency of 5000Hz, duty_u16=32768. All other ports now requires freq and duty rate to be set deliberately to get a signal.

  3. converted this issue into a discussion #13601 on Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions