Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after cleanup voltage still on pin #66

Open
gek47 opened this issue Jan 17, 2023 · 0 comments
Open

after cleanup voltage still on pin #66

gek47 opened this issue Jan 17, 2023 · 0 comments

Comments

@gek47
Copy link

gek47 commented Jan 17, 2023

Set pin pull to to UP and cleanup does set the bias to the correct state but voltage is still on the pin.
I was seeing odd behavior, so I check the pin with a VOM and shows 3.28 volts after cleanup.
If I call setbias(pin, GPIO_DISABLE) before cleanup no voltage.

Test setup is Raspberry PI 4B 4GB, Archlinux Arm aarch64 mainline kernel

$ uname -a
Linux landmine 5.19.8-1-aarch64-ARCH #1 SMP PREEMPT Thu Sep 8 18:20:33 MDT 2022 aarch64 GNU/Linu


import RPi.GPIO as GPIO
import time   

GPIO.setmode(GPIO.BCM)

print(f"PUD_OFF:  {GPIO.PUD_OFF}")
print(f"PUD_UP:   {GPIO.PUD_UP}")
print(f"PUD_DOWN: {GPIO.PUD_DOWN}")


TEST_PIN = 26
GPIO.setup(TEST_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)

time.sleep(2)
print(f"before cleanup getbias: {GPIO.getbias(TEST_PIN)}")

print(f"before cleanup getdirection: {GPIO.getdirection(TEST_PIN)}")

GPIO.cleanup()

time.sleep(2)


time.sleep(2)
print(f"after cleanup getbias: {GPIO.getbias(TEST_PIN)}")

print(f"after cleanup getdirection: {GPIO.getdirection(TEST_PIN)}")


Output:
PUD_OFF:  1
PUD_UP:   3
PUD_DOWN: 4
before cleanup getbias: 3
before cleanup getdirection: 2
after cleanup getbias: 1
after cleanup getdirection: -1

Thanks
GEK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant