bbcmicrobit / micropython

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

ValueError: invalid period #700

Closed hnwangkg-ezio closed 2 years ago

hnwangkg-ezio commented 3 years ago

打扰了,我有个问题,我的代码是这样写的,: from microbit import * pin0.set_analog_period(20)

然后下载进micro bit V2 打印的logo是这样的: croPython v1.13 on 2020-12-21; micro:bit v2.0.0-beta.3 with nRF52833 Type "help()" for more information.

import microbit microbit.reset() Traceback (most recent call last): File "main.py", line 86, in File "main.py", line 18, in init VaTraceback (most recent call last): File "main.py", line 86, in File "main.py", line 18, in init ValueError: invalid period

但是micro bit V1的正常

hnwangkg-ezio commented 3 years ago

Excuse me, I have a question. My code is written like this: from microbit import * pin0.set_analog_period(20)

Then download into micro bit V2 The printed logo looks like this: croPython v1.13 on 2020-12-21; micro:bit v2.0.0-beta.3 with nRF52833 Type "help()" for more information.

import microbit microbit.reset() Traceback (most recent call last): File "main.py", line 86, in File "main.py", line 18, in init VaTraceback (most recent call last): File "main.py", line 86, in File "main.py", line 18, in init ValueError: invalid period

But the micro bit V1 is normal

microbit-carlos commented 3 years ago

Hi @hnwangkg-ezio,

It looks like you script had more code and there was an invalid period (.) in line 18. Do you have the full code?

microbit-carlos commented 2 years ago

Closing due to lack of activity, hopefully this was just an issue in the coding having invalid syntax. @hnwangkg-ezio if you are still experiencing this feel free to reopen it and we can look into this.