PWM Parameters #10759
Unanswered
jimcraig47
asked this question in
RP2040 / Pico
PWM Parameters
#10759
Replies: 2 comments 1 reply
-
That is indeed an inconsistency. At the RP2 port the PWM constructor does not accept additional arguments. You have to do it step-by-step, e.g.:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
It currently allows one positional argument ( pwm1 = machine.PWM(machine.Pin(28), freq=1000, invert=False) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
from machine import Pin, PWM
freq = 1000
led = PWM(Pin(10), freq)
When I run this code on an ESP32 it runs fine. Trying to understand why when I run the same code on a Raspberry Pi Pico I get the "TypeError: function takes 1 positional arguments but 2 were given" for the last line.
Beta Was this translation helpful? Give feedback.
All reactions