1 Star 1 Fork 0

岑剑伟 / MicroPython-Samples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
firmware.py 786 Bytes
一键复制 编辑 原始数据 按行查看 历史
Juwan 提交于 2019-08-27 17:43 . ready
import os
import time
def set_firmware(com):
try:
from mp.mpfshell import MpFileShell
shell = MpFileShell(help=True)
shell.do_open(com)
shell.do_put('microbit')
except Exception as e:
print(e)
return str(e)
def get_firmware(com):
try:
import sys
sys.argv = [
'AutoFlash.py', '--chip', 'esp32',
'--port', com,
'--baud', '921600',
'read_flash', '0x1000', '0x250000', 'firmware.bin'
]
from esptool import main
main()
return None
except Exception as e:
print(e)
return str(e)
if __name__ == "__main__":
local_com = 'com5'
set_firmware(local_com)
# get_firmware(local_com)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/genvex/MicroPython-Samples.git
git@gitee.com:genvex/MicroPython-Samples.git
genvex
MicroPython-Samples
MicroPython-Samples
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891