MAIX BiT(K201)基础

请同时参阅https://blog.csdn.net/Thousand_drive/article/details/123822939

安装CH341驱动

MAiX BiT是载有K210芯片的开发板的名称

首先在把开发板连接到电脑上,并安装CH341驱动

K210端的软件:安装固件

安装固件可以理解为给K210烧录程序,通过软件kflash_gui来完成

PC端的软件:IDE

安装maixpy-ide

运行Hello World Example

打开maixpy-ide默认打开Hello World Example的例子,如下所示。按这个文件的说明运行,成功后可以读取摄像头信息并显示,如下图所示

# Hello World Example
#
# Welcome to the MaixPy IDE!
# 1. Conenct board to computer
# 2. Select board at the top of MaixPy IDE: `tools->Select Board`
# 3. Click the connect buttion below to connect board
# 4. Click on the green run arrow button below to run the script!

import sensor, image, time, lcd

lcd.init(freq=15000000)
sensor.reset()                      # Reset and initialize the sensor. It will
                                    # run automatically, call sensor.run(0) to stop
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
clock = time.clock()                # Create a clock object to track the FPS.

while(True):
    clock.tick()                    # Update the FPS clock.
    img = sensor.snapshot()         # Take a picture and return the image.
    lcd.display(img)                # Display on LCD
    print(clock.fps())              # Note: MaixPy's Cam runs about half as fast when connected
                                    # to the IDE. The FPS should increase once disconnected.
									

点亮一个灯的程序

from Maix import GPIO
from fpioa_manager import fm

#将蓝灯引脚IO12配置到GPIO0,K210引脚支持任意配置
fm.register(12, fm.fpioa.GPIO0)

LED_B = GPIO(GPIO.GPIO0, GPIO.OUT) #构建LED对象
LED_B.value(0) #点亮LED
============================找指导老师布置任务吧==============================