bbcmicrobit / micropython

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

pin5.write_digital(0) ValueError: Pin 5 in button mode #693

Closed YFROBOTZL closed 3 years ago

YFROBOTZL commented 3 years ago

pin5.write_digital(0)

ValueError: Pin 5 in button mode

microbit-carlos commented 3 years ago

Hi @finalvalue,

Pin 5 is connected to button A on the micro:bit, which is why it's configured in button mode. If you other pins available is recommendable to use those before the pins shared with other micro:bit functionality (like the buttons or the display).

You can find more info about the pins in the documentation: https://microbit-micropython.readthedocs.io/en/latest/pin.html

YFROBOTZL commented 3 years ago

Yes, the current problem is that the hardware uses P5 and P11 pins, which can be used in makecode but not in micropython.

Change the hardware later,。

@microbit-carlos thanks for the reply!