From c887abf9ad2558ecc44cb7fefdf05cf22fd4ec2d Mon Sep 17 00:00:00 2001 From: Tomas Krejci Date: Wed, 22 May 2024 17:00:09 +0200 Subject: [PATCH] up --- main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index d5b9901..49ab0b2 100644 --- a/main.py +++ b/main.py @@ -3,6 +3,7 @@ # Tomas Krejci [Njord] +import machine, time from sys import platform ESP32 = platform == 'esp32' RP2 = platform == 'rp2' @@ -12,16 +13,21 @@ if ESP32 or RP2: else: from pyb import Pin, LED import uasyncio as asyncio -from primitives.switch import Switch +#from primitives.switch import Switch from primitives.delay_ms import Delay_ms -# Import all implemented classes -from olt_lib.ir_tx.olt import LT_24, SONY_12, SONY_15, SONY_20 +import primitives.queue as queue +from primitives import Switch, Pushbutton +from rgb import RGB async def main(proto): + onboar_led = machine.Pin("LED", machine.Pin.OUT) # Pi Pico onboard LED while True: - print("main while running") - await asyncio.sleep(3) + print(f"main while running: {time.ticks_ms()}") + onboar_led.on() + await asyncio.sleep_ms(100) + onboar_led.off() + await asyncio.sleep(1) @@ -30,7 +36,7 @@ try: except KeyboardInterrupt: print("Interrupted") - + finally: asyncio.new_event_loop() print('End')