【雕爷学编程】MicroPython动手做(02)——尝试搭建K210开发板的IDE环境4

7、使用串口工具

(1)连接硬件

连接 Type C 线, 一端电脑一端开发板

查看设备是否已经正确识别:

在 Windows 下可以打开设备管理器来查看

如果没有发现设备, 需要确认有没有装驱动以及接触是否良好

(2)下载串口工具

(a) putty

https://www.chiark.greenend.org.uk/\~sgtatham/putty/latest.html

(b)xshell

https://xshell.en.softonic.com/download

(3)然后选择串口模式, 然后设置串口和波特率,打开串口。

(4)检查固件版本

使用串口终端PuTTY打开串口,然后复位(或按ctrl+D),看输出的版本信息,与github 或者 master 分支 的固件版本对比,根据当前版本情况考虑升级到最新版本。这里烧录的固件版本是" v0.5.0-31-gd3e71c0" 。

(5)串口终端PuTTY的控制命令:

CTRL-A-在空白行上,进入原始REPL模式

CTRL-B-在空白行上,进入常规REPL模式

CTRL-C-中断正在运行的程序

CTRL-D-在空白行上,对电路板进行软复位

CTRL-E-在空白行上进入粘贴模式

(6)有关可用模块的列表,请键入help('modules')

KPU gc random uio

Maix hashlib re ujson
main heapq sensor ulab

_boot image socket uos

_thread json struct urandom

_webrepl lcd sys ure

array machine time usocket

audio math touchscreen ustruct

binascii math ubinascii utime

board micropython ucollections utimeq

builtins modules ucryptolib uzlib

cmath nes uctypes video

collections network uerrno zlib

errno os uhashlib

fpioa_manager pye_mp uheapq

Plus any modules on the filesystem

8、Hello world!

#尝试搭建K210的Micropython开发环境(Win10)

#实验程序之一:串口打印'hello maixpy',固件版本号

python 复制代码
#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之一:串口打印'hello maixpy',固件版本号

import sys

for i in range(0, 2):
    print("hello maixpy")
    print("hello ", end="maixpy\n")

print("implementation:", sys.implementation)
print("platform:", sys.platform)
print("path:", sys.path)
print("Python version:", sys.version)

print("please input string, end with Enter")
r = sys.stdin.readline()
w_len = sys.stdout.write(r)

#尝试搭建K210的Micropython开发环境(Win10)

#实验程序之二:IDE中断

python 复制代码
#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之二:IDE中断

import _thread
import time

def func(name):
    while 1:
        print("hello {}".format(name))
        time.sleep(1)

_thread.start_new_thread(func,("1",))
_thread.start_new_thread(func,("2",))

while 1:
    pass
相关推荐
大数据在线4 分钟前
硬件涨价超级周期:智算中心价值逻辑迎来重构
人工智能·数据中心·智算中心·内存涨价·曙光存储
2501_941652774 分钟前
改进YOLOv5-BiFPN-SDI实现牙齿龋齿检测与分类_深度学习_计算机视觉_原创
深度学习·yolo·分类
2301_810730106 分钟前
python第四次作业
数据结构·python·算法
马剑威(威哥爱编程)7 分钟前
Libvio.link爬虫技术解析:搞定反爬机制
爬虫·python
肾透侧视攻城狮10 分钟前
《PyTorch神经网络从开发到调试:实战技巧、可视化与兼容性问题解决方案》
神经网络·语言模型·二分类任务·实现前馈神经网络·可视化执行梯度下降算法·matplotlib版本兼容性·pytorch实现二分类任务
7***n7511 分钟前
2026年AI搜索时代的品牌显性化挑战与微盟星启解决方案解析
人工智能
zhougl99614 分钟前
Java 枚举类(enum)详解
java·开发语言·python
恋爱绝缘体118 分钟前
Java语言提供了八种基本类型。六种数字类型【函数基数噶】
java·python·算法
Loacnasfhia919 分钟前
卷烟爆珠气泡缺陷检测与分类_YOLO11创新点改进_C3k2与MLCA模块融合结构研究_1
人工智能·目标跟踪·分类
雨大王51219 分钟前
汽车制造数字化转型如何选择靠谱的产业链服务商?
人工智能