← index #6538PR #16607
Off-topic · high · value 5.348
QUERY · ISSUE

machine.Pin doesn't have a pin() method on the ESP32 port

openby mattytrentiniopened 2020-10-10updated 2024-09-14
enhancementport-esp32

As reported in the Slack channel, the ESP32 port lacks a method to retrieve the pin number.

(It's possible to print the pin object but this is fragile and requires that the number be parsed from the string.)

The nRF and stm32 ports both have a pin() method on a Pin; the same should exist for the ESP32.

CANDIDATE · PULL REQUEST

machine.Pin: Implement Pin.toggle() for three ports.

mergedby robert-hhopened 2025-01-18updated 2025-02-28
port-esp8266port-esp32port-cc3200

Summary

The ESP32, ESP8266 and CC3200 ports did not provide the method Pin.toggle(). This PR adds it.

Testing

Tested with:

  • ESP32
  • ESP32C3
  • ESP32C6
  • ESP32S2
  • ESP32S3
  • ESP8266
  • WiPY 1 (CC3200)

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied