QUERY · ISSUE
esp32/machine_pin: ESP32-P4 pin 54 can't be set to output
bugport-esp32
Port, board and/or hardware
esp32 port, generic ESP32-P4 board
MicroPython version
MicroPython v1.27.0 on 2025-12-09; Generic ESP32P4 module with ESP32P4
Reproduction
MicroPython v1.27.0 on 2025-12-09; Generic ESP32P4 module with ESP32P4
Type "help()" for more information.
>>> import machine
>>> machine.Pin(53, machine.Pin.OUT)
Pin(53)
>>> machine.Pin(54, machine.Pin.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: pin can only be input
Expected behaviour
machine.Pin(54, machine.Pin.OUT) should work, because all GPIO pins on the ESP32-P4 are output capable.
Observed behaviour
machine.Pin(54, machine.Pin.OUT) states pin can only be input, which is false.
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
CANDIDATE · ISSUE
Pin toggle function does not exist in ESP32.
enhancementport-esp32
Port, board and/or hardware
esp32
MicroPython version
MicroPython v1.24.1 on 2024-11-29; Generic ESP32 module with ESP32
Reproduction
from machine import Pin
p=Pin(2, Pin.OUT)
p.toggle()
Expected behaviour
Toggling the pin :D
Observed behaviour
the toggle function is not implemented.
So I do:
p.value(not p.value())
But from the docs I thought it was implemented.
It would be nice to have it, for code clarity but also for speed.
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree