diff --git a/HW/timer_button/3D/Tlacitko_top.SLDPRT b/HW/timer_button/3D/Tlacitko_top.SLDPRT new file mode 100644 index 0000000..b89d883 Binary files /dev/null and b/HW/timer_button/3D/Tlacitko_top.SLDPRT differ diff --git a/HW/timer_button/3D/Tlacitko_top.STL b/HW/timer_button/3D/Tlacitko_top.STL new file mode 100644 index 0000000..b5e7a34 Binary files /dev/null and b/HW/timer_button/3D/Tlacitko_top.STL differ diff --git a/HW/timer_button/~timer_button.kicad_sch.lck b/HW/timer_button/~timer_button.kicad_sch.lck index af8d837..61c7f2b 100644 --- a/HW/timer_button/~timer_button.kicad_sch.lck +++ b/HW/timer_button/~timer_button.kicad_sch.lck @@ -1 +1 @@ -{"hostname":"spock","username":"angoosh"} \ No newline at end of file +{"hostname":"Oneill","username":"angoosh"} \ No newline at end of file diff --git a/SW/RPi_Pico_Button/main.py b/SW/RPi_Pico_Button/main.py index 85efc76..710150c 100644 --- a/SW/RPi_Pico_Button/main.py +++ b/SW/RPi_Pico_Button/main.py @@ -11,7 +11,8 @@ BRIGHTNESS = 0.2 # Adjust the brightness (0.0 - 1.0) led_strip = neopixel.NeoPixel(Pin(ws_pin), led_num) -push_button = Pin(24,Pin.IN,Pin.PULL_UP) +push_button = Pin(24, Pin.IN, Pin.PULL_UP) +buzzer = Pin(3, Pin.OUT) pushbutton_pressed = 0 blink_interrupted = 0 @@ -80,19 +81,24 @@ def blink_and_beep(times): blink_delay = 0.2 #insert beep + buzzer.value(1) for i in range(0, times): set_neopixel_color(255, 0, 0) + buzzer.value(0) time.sleep(blink_delay) set_neopixel_color(0, 0, 0) + buzzer.value(1) time.sleep(blink_delay) if pushbutton_pressed == 1: pushbutton_pressed = 0 blink_interrupted = 1 i = times + buzzer.value(0) return + buzzer.value(0) ten_min_timer = 0 -ten_min_timer_led_index = 0 +ten_min_timer_led_index = 11 def count_10_min(): global ten_min_timer, ten_min_timer_led_index, pushbutton_pressed, blink_interrupted @@ -135,6 +141,15 @@ def button_callback(push_button): set_neopixel_color(0,0,0) push_button.irq(trigger=Pin.IRQ_FALLING, handler=button_callback) +green = (0, 255, 0) +green = set_neopixel_brightness(green) +led_strip[0] = green +led_strip[2] = green +led_strip[4] = green +led_strip[6] = green +led_strip[8] = green +led_strip.write() + while True: count_10_min() - time.sleep(1) \ No newline at end of file + time.sleep(0.01) \ No newline at end of file