#Test_PB_Most_Simple.py # by D@CC on 2023DApr26 #This is the first routine in the ixRPC system # with no subrouttines #Read PB on GPIO22 once. progName = "Test_PB_Most_Simple.py" GPIO22=22 #initialize import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(GPIO22,GPIO.IN) ############ init complete ############## # Now read the pushButton on GPIO22 once if True: # read the pushbutton if GPIO.input(GPIO22): print("PushButton GPIO22 was pressed") else: print("PushButton GPIO22 was Not pressed") #if end #if end print("end of program:",progName) #Source: http://ephotocaption.com/a/193/193.html #Saved in Source 25 in that article #saved in E:\E\2022\DevE\MyPagesE\Globat\ePhotoCaption.com\a\193\Test_PB_Most_Simple..txt #/Test_PB_Most_Simple.txt