import utime
from machine import Pin
import _thread
utime.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
led_interno = Pin(4, Pin.OUT)
semaforo = _thread.allocate_lock()
def primeira_thread():
while True:
semaforo.acquire()
print("Primeira Thread")
utime.sleep(0.1)
semaforo.release()
_thread.start_new_thread(primeira_thread, ())
while True:
semaforo.acquire()
led_interno.toggle()
utime.sleep(1)
semaforo.release()