Closed microbit-carlos closed 2 years ago
Right now the write_analog, set_analog_period, and set_analog_period_microseconds methods are only declared in the MicroBitAnalogDigitalPin class, but these PWM methods are available in all digital pins.
write_analog
set_analog_period
set_analog_period_microseconds
MicroBitAnalogDigitalPin
https://github.com/microbit-foundation/micropython-microbit-stubs/blob/7499fc8799b3a88e5038a2324dae264b1516ede7/typeshed/stdlib/microbit/__init__.pyi#L171-L193
The MicroPython docs, which had this issue, were fixed here: https://github.com/bbcmicrobit/micropython/pull/629/files
https://microbit-micropython.readthedocs.io/en/v2-docs/pin.html#microbit.MicroBitDigitalPin
Right now the
write_analog
,set_analog_period
, andset_analog_period_microseconds
methods are only declared in theMicroBitAnalogDigitalPin
class, but these PWM methods are available in all digital pins.https://github.com/microbit-foundation/micropython-microbit-stubs/blob/7499fc8799b3a88e5038a2324dae264b1516ede7/typeshed/stdlib/microbit/__init__.pyi#L171-L193