boot.py 654 B

1234567891011121314151617181920212223242526
  1. # boot.py -- run on boot-up
  2. # can run arbitrary Python, but best to keep it minimal
  3. print("")
  4. print(" WinnerMicro W600")
  5. print("")
  6. try:
  7. import machine
  8. from config import LED_LIST
  9. for i in range(len(LED_LIST)):
  10. pin = machine.Pin(LED_LIST[i][1], machine.Pin.OUT, machine.Pin.PULL_DOWN)
  11. machine.PWM(pin, channel=LED_LIST[i][2], freq=800, duty=LED_LIST[i][3])
  12. import network
  13. station = network.WLAN(network.STA_IF)
  14. if station.isconnected() == False:
  15. from wifi_config import *
  16. import easyw600
  17. easyw600.connect(WIFI_SSID, WIFI_PASSWD)
  18. easyw600.ftpserver()
  19. except:
  20. print("boot error")