microbit-foundation / micropython-microbit-v2

Temporary home for MicroPython for micro:bit v2 as we stablise it before pushing upstream
MIT License
41 stars 22 forks source link

`pin.set_analog_period(0)` stops PWM output from working again #141

Open microbit-carlos opened 1 year ago

microbit-carlos commented 1 year ago

To replicate, in the REPL while watching pin16 in an oscilloscope or signal analyser:

>>> pin16.write_analog(512)                 # signal appears at 50 Hz
>>> pin16.set_analog_period(1)              # signal at 1 KHz
>>> pin16.set_analog_period_microseconds(1) # signal at 1 MhHz
>>> pin16.set_analog_period_microseconds(0) # signal always high
>>> pin16.set_analog_period(1)              # signal still always high

I'll try to replicate with CODAL as well and raise an issue there if necessary.

microbit-carlos commented 1 year ago

Raised in CODAL: