orangepi_PC_gpio_pyH3 icon indicating copy to clipboard operation
orangepi_PC_gpio_pyH3 copied to clipboard

Voltage on pin in INPUT mode?

Open AdvancedStyle opened this issue 4 years ago • 0 comments

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))

AdvancedStyle avatar Aug 01 '20 13:08 AdvancedStyle