from machine import Pin
import time
import _thread
led_core0 = Pin("LED", Pin.OUT)
led_core1 = Pin(4, Pin.OUT)
def blink_core1():
while True:
led_core1.toggle()
time.sleep(0.2)
# start core 1
_thread.start_new_thread(blink_core1, ())
# core 0 loop
while True:
led_core0.toggle()
time.sleep(1)