light-serial.py 166 B

12345678910
  1. from machine import Pin
  2. import time
  3. cn1 = Pin(18, Pin.OUT)
  4. while True:
  5. cn1.on()
  6. print('on')
  7. time.sleep(1)
  8. cn1.off()
  9. print('off')
  10. time.sleep(1)