Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8037

Troubleshooting • Re: Reading a simple GPIO push button from NodeJS on a Raspberry Pi 5

$
0
0
The pin numbering is a bit weird. On the Pi5 enter this command

Code:

cat /sys/kernel/debug/gpio
You will see

Code:

...gpiochip0: GPIOs 571-624, parent: platform/1f000d0000.gpio, pinctrl-rp1: gpio-571 (ID_SDA              ) gpio-572 (ID_SCL              ) gpio-573 (GPIO2               ) gpio-574 (GPIO3               )...
So we use 573 for GPIO2

Code:

const button = new Gpio(573, 'in', 'both');

Statistics: Posted by neilgl — Mon Feb 24, 2025 2:00 pm



Viewing all articles
Browse latest Browse all 8037

Trending Articles