Quick Start
About 1 min
Flash Firmware
Download firmware from GitHub or the Canaan Developer Community. After downloading the firmware for your board, follow the Firmware Flashing Guide to flash it to the board.
Download CanMV-IDE
CanMV-K230D Zero supports development with CanMV-IDE. You can run code, view results, and preview images through the IDE. Go to Download CanMV-IDE. For detailed usage, refer to the IDE User Guide.
Run Demo Programs
The CanMV-K230D Zero firmware includes many pre-installed demo programs that you can run without downloading from the network. Open examples from the virtual USB drive in the IDE to run them quickly. For detailed steps, refer to How to Run Demo Programs
- After flashing firmware and connecting the K230D to CanMV, open CanMV IDE K230 and copy the following code into it:
# Camera Example
import time, os, sys
from media.sensor import *
from media.display import *
from media.media import *
sensor = None
try:
print("camera_test")
# construct a Sensor object with default configure
sensor = Sensor()
# sensor reset
sensor.reset()
# set hmirror
# sensor.set_hmirror(False)
# sensor vflip
# sensor.set_vflip(False)
# set chn0 output size, 800x480
sensor.set_framesize(width = 800, height = 480)
# set chn0 output format
sensor.set_pixformat(Sensor.YUV420SP)
# bind sensor chn0 to display layer video 1
bind_info = sensor.bind_info()
Display.bind_layer(**bind_info, layer = Display.LAYER_VIDEO1)
# use lcd as display output
Display.init(Display.ST7701, width = 800, height = 480, to_ide = True)
# init media manager
MediaManager.init()
# sensor start run
sensor.run()
while True:
os.exitpoint()
except KeyboardInterrupt as e:
print("user stop: ", e)
except BaseException as e:
print(f"Exception {e}")
finally:
# sensor stop run
if isinstance(sensor, Sensor):
sensor.stop()
# deinit display
Display.deinit()
os.exitpoint(os.EXITPOINT_ENABLE_SLEEP)
time.sleep_ms(100)
# release media buffer
MediaManager.deinit()Step 2: Click Run.
Step 3: The camera feed will appear in CanMV's frame buffer.