This commit is contained in:
tillraab 2019-09-10 11:36:15 +02:00
parent 5957b30b8f
commit 38a5f3c8c2

View File

@ -1,7 +1,7 @@
import RPi.GPIO as GPIO
from uldaq import (get_daq_device_inventory, DaqDevice, AInScanFlag, ScanStatus,
ScanOption, create_float_buffer, InterfaceType, AiInputMode)
from time import time
from time import time, sleep
def GPIO_setup(LED1_pin, LED2_pin, Button1_pin, Button2_pin):
@ -43,7 +43,7 @@ def main():
# loop_t = time()
while time() - t0 < 5:
while time() - t0 < 10:
# print(time() - loop_t)
# LED1 blink every 2 sec
if time() - LED1_t < .1 and LED_status[0] == False:
@ -75,7 +75,13 @@ def main():
if GPIO.input(Button2_pin) == GPIO.HIGH:
print('button 2 pressed')
if GPIO.input(Button1_pin) == GPIO.HIGH:
if LED_status[0] == False:
GPIO.output(LED1_pin, GPIO.HIGH)
if LED_status[1] == False:
GPIO.output(LED2_pin, GPIO.HIGH)
sleep(2)
break
# loop_t = time()