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

Voltage on pin in INPUT mode? #18

Open
AdvancedStyle opened this issue Aug 1, 2020 · 0 comments
Open

Voltage on pin in INPUT mode? #18

AdvancedStyle opened this issue Aug 1, 2020 · 0 comments

Comments

@AdvancedStyle
Copy link

I'm having a problem reading the state on PA19, as it is setting itself to HIGH in INPUT mode?

I have an LED connected between PA19 (via 1k resistor) and GND, then I run the simple script below.

Expected result:

LED remains turned off and "0" is printed

Actual result:

LED turns on and "1" is printed

What am i doing wrong?

#!/usr/local/bin/python

from pyA20.gpio import gpio
from pyA20.gpio import port

pin_to_circuit = port.PA19

gpio.init()

gpio.setcfg(pin_to_circuit, gpio.OUTPUT)
gpio.output(pin_to_circuit, 0)

gpio.setcfg(pin_to_circuit, gpio.INPUT)
print(gpio.input(pin_to_circuit))

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