首先连接好摄像头端口,点击运行闪烁灯代码(代码如下):
#import time, pyb from time import sleep from pyb import LED led1 = LED(1) led2 = LED(2) led3 = LED(3) # Red LED = 1, Green LED = 2, Blue LED = 3, IR LEDs = 4. #usb = pyb.USB_VCP() # This is a serial port object that allows you to # communciate with your computer. While it is not open the code below runs. while(1): led1.on() sleep(1000) led1.off() led2.on() sleep(1000) led2.off() led3.on() sleep(1000) led3.off()
现象:红、绿、蓝三色灯交替闪烁,间隔时间为1秒
接下来,在openmvIDE任务栏中选中工具选项当中的:将打开的脚本保存到openmv cam(作为main.py)
保存完之后,在U盘中查看:生成了一个main.py的文件,并且red灯闪烁几次
保存成功后,首先拔掉数据线,然后在上电,即可实现脱机运行。
脱机运行现象:红、绿、蓝三色灯交替闪烁,间隔时间为1秒,和以上一致
正是步行者,一步步登峰!