up
This commit is contained in:
parent
62e5396cd1
commit
c887abf9ad
18
main.py
18
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')
|
||||
|
Loading…
Reference in New Issue
Block a user