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

Beginners • Re: GPIO pins always stuck on low

$
0
0
Hey all,

I am currently working with a limit switch and the pi. While testing the limit switch, I interrupted the script with the keyboard.

Since having done that, I no longer get a response to say the limit switch has been pressed from my GPIO pin. Through raspi-config I have checked the status of the pins and am able to reset the pins, so I don't think it's the physical pins.

However, I've tried GPIO pins 16, 20 and 21, and they all worked the first time, and displayed the correct information when I clicked the limit switch.

But after an interrupt on each of those pins, I can no longer get the pi to read the limit switch on those pins.

This is the code I have so far

What am I doing wrong?



As a trivial and pedantic, but significant, question:

How do you 'interrupt' the script. That sounds as though it is not the same thing as 'terminating' the script.

If your original, working, run of the script is still running in the background perhaps the issue is that it still has control of the GPIO pins and any subsequent run therefore cannot proceed successfully?

Statistics: Posted by B.Goode — Wed Jul 03, 2024 12:55 pm



Viewing all articles
Browse latest Browse all 6169

Latest Images

Trending Articles



Latest Images