Elektronik komplett
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import RPi.GPIO as GPIO
|
||||
import time
|
||||
|
||||
GPIO.setwarnings(False)
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(24, GPIO.OUT)
|
||||
|
||||
while True:
|
||||
GPIO.output(24, True)
|
||||
time.sleep(1)
|
||||
GPIO.output(24, False)
|
||||
time.sleep(1)
|
||||
@@ -10,15 +10,15 @@ GPIO.setup(17, GPIO.OUT)
|
||||
GPIO.output(17, GPIO.LOW)
|
||||
|
||||
try:
|
||||
print('Start IR test')
|
||||
print('Start sensor test')
|
||||
|
||||
while True:
|
||||
time.sleep(0.25)
|
||||
if (GPIO.input(4) == GPIO.LOW):
|
||||
print('LED OFF')
|
||||
print('LOW')
|
||||
GPIO.output(17, GPIO.LOW)
|
||||
else:
|
||||
print('LED ON')
|
||||
print('HIGH')
|
||||
GPIO.output(17, GPIO.HIGH)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
Reference in New Issue
Block a user