|
在windows 下把MicroPython开发板通过USB 连接到电脑上。
windows会识别一个U盘。如下所示:
打开这个PYBFLASH的U盘,可以看到如下的文件:
boot.py – this script is executed when the pyboard boots up. It setsup various configuration options for the pyboard. 开发板上电的时候第一次执行的文件。类似于arduino的setup()
main.py – this is the main script that will contain your Python program.It is executed after boot.py. 在boot.py之后执行的程序,用户的代码可以写在这里面。
README.txt – this contains some very basic information about gettingstarted with the pyboard.
pybcdc.inf – this is a Windows driver file to configure the serial USBdevice. More about this in the next tutorial.
修改 main.py 文件如下:
- <font size="5"># main.py -- put your code here!
- from pyb import LED
- led = LED(1) # red led
- led.toggle()
- led.on()</font>
复制代码 上电,即可看到 红色led点亮。
编程变得如此的简单。。。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|