import pyRTOS
from machine import Pin
LEDr = Pin(15, mode=Pin.OUT)
contador = 1
mutex = pyRTOS.Mutex()
def LED_1(self):
while True:
yield [mutex.lock(self)]
LEDr.on()
yield [pyRTOS.timeout(0.5)]
LEDr.off()
yield [pyRTOS.timeout(0.5)]
mutex.unlock()
pyRTOS.add_task(pyRTOS.Task(LED_1, name="tarea_1", mailbox=True, priority 0))
pyRTOS.start()