openmv--lcd显示屏的使用
移植:
1.import display 导入库
2.sensor.set_framesize(sensor.QQVGA2) 设置分辨率,lcd的分辨率是160*128,如果原代码中是QQVGA,也可以不用改
3.lcd = display.SPIDisplay() lcd初始化
4.sensor.set_vflip(True)(翻转图片,可选)
sensor.set_hmirror(True)
5.lcd.write(sensor.snapshot())lcd显示图像(显示彩图和灰度图均可,具体看sensor.set_pixformat的设置)
import sensor
import display
sensor.reset() // Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) // or sensor.GRAYSCALE
sensor.set_framesize(sensor.QQVGA2) // Special 128x160 framesize for LCD Shield.
// Initialize the lcd screen.
// Note: A DAC or a PWM backlight controller can be used to control the
// backlight intensity if supported:
lcd = display.SPIDisplay(backlight=display.DACBacklight(channel=2))
lcd.backlight(25) // 25% intensity
// Otherwise the default GPIO (on/off) controller is used.
lcd = display.SPIDisplay()
while True:
lcd.write(sensor.snapshot()) // Take a picture and display the image.
浙公网安备 33010602011771号