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

General • Re: Using all GPIO pins

$
0
0
will have to rethink this.
Being "tolerant of 5V" rather than being "5V tolerant" is rather complicated on an RP2040. The ADC are I recall less so, and that could be the main problem here.

The solution should be easy enough whatever you do. The simplest is to move the switch connections from 5V to 3V3, or change 5V to 0V and adjust the GPIO initialisation to pull-up rather than pull-down.

If switching to pull-up, having active low switches, you will probably need to adjust your code to deal with that. If there's a single "SWITCH_IS_ON" constant defined which you compare input values with you should be able to change that from "1" to "0" and that's it. I believe it's also possible to have the hardware handle the input inversion.

If it still doesn't work after any change it would be worth trying with a different Pico just in case the one you have has been damaged through applying 5V.

Statistics: Posted by hippy — Sat Aug 03, 2024 4:37 pm



Viewing all articles
Browse latest Browse all 4906

Trending Articles