bbcmicrobit / micropython

Port of MicroPython for the BBC micro:bit
https://microbit-micropython.readthedocs.io
Other
595 stars 287 forks source link

set_analog_period() allways gives "ValueError: invalid period" error on V2 #710

Closed azamat-bagatov closed 3 years ago

azamat-bagatov commented 3 years ago

Hi everyone, I think I found a MicroBit V2 specific bug.

`from microbit import *

pin2.set_analog_period(10)`

This code works on V1, but on V2 it gives ValueError: invalid period, no matter what value or what pin you pick.

I'm loading it over online python editor via Chrome browser on Win 10. But everything else seems to port fine from V1 to V2, just the code that uses PWM has issues.

microbit-carlos commented 3 years ago

Hi @azamat-bagatov,

Thanks for the report. This repo is for the V1 version of MicroPython, the v2 the issue tracker can be found in https://github.com/microbit-foundation/micropython-microbit-v2/issues/

I think has been fixed already in the beta.4 release and can be tested in the latest beta version of the online Python Editor:

Could you give that a go to confirm if it's been fixed? If not we can open a new ticket in the V2 repo.

Thanks again!