diff --git a/LED_check.py b/LED_check.py index 30620ec..a0b8aa5 100644 --- a/LED_check.py +++ b/LED_check.py @@ -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()