import time
import OPi.GPIO as GPIO
GPIO.setmode(GPIO.SUNXI)
GPIO.setup("PA0", GPIO.IN)
GPIO.setup("PA1", GPIO.IN)
while True:
if GPIO.input("PA0") == GPIO.input("PA1"):
print("321")
else:
print("123")
time.sleep(0.1)
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN,pull_up_down=GPIO.PUD_UP)
while True:
inputValue = GPIO.input(18)
if (inputValue == False):
print("Button press ")
time.sleep(0.3)