restart.py 394 B

123456789101112131415161718192021222324
  1. import time
  2. import machine
  3. from sensor.led import LED
  4. import uasyncio as asyncio
  5. from machine import WDT
  6. led = LED(25)
  7. n = 20
  8. while n:
  9. n -= 1
  10. time.sleep(0.05)
  11. led.toggle()
  12. wdt = WDT(timeout=500) # 超时时间单位为毫秒
  13. # machine.reset()
  14. #
  15. # # 上传重启脚本
  16. # ampy --port COM37 put test/reset.py
  17. # # 运行重启脚本
  18. # ampy --port COM37 run /re_set.py
  19. # /reset.py