moving things around and adding examples for mic hat code
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import RPi.GPIO as GPIO
|
||||
import time
|
||||
|
||||
BUTTON = 17
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(BUTTON, GPIO.IN)
|
||||
|
||||
while True:
|
||||
state = GPIO.input(BUTTON)
|
||||
if state:
|
||||
print("off")
|
||||
else:
|
||||
print("on")
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user