K210 LCD显示

整体代码:

import lcd, sensor, time

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_auto_exposure(1)
sensor.set_auto_gain(0, gain_db = 12)
sensor.set_auto_whitebal(0, rgb_gain_db = (0,0,0))
sensor.set_vflip(1)
sensor.set_hmirror(1)
sensor.skip_frames(time = 2000)

class lcd_show_data():
    year = 2024
    month = 01
    dat = 24
    hour = 21
    minute = 23
ping = lcd_show_data()
def lcd_show():
    lcd.draw_string(0, 0,  "Hello World", lcd.RED, lcd.WHITE)
    lcd.draw_string(0, 15, str(ping.year)+"/"+str(ping.month)+"/"+str(ping.dat), lcd.RED, lcd.WHITE)
    lcd.draw_string(0, 30, str(ping.hour)+":"+str(ping.minute), lcd.RED, lcd.WHITE)

lcd.init(freq=15000000,color=0XFFFF,invert=1,lcd_type=0)
clock = time.clock()

while(True):
    clock.tick()
    img = sensor.snapshot()
    fps = clock.fps()
    img.draw_string(230,0,("%2.1ffps"%(fps)),color=(0,0,128),scale=2)
    lcd.display(img)
    lcd_show()

效果展示:

程序说明:

1.导入库文件

import lcd, sensor, time

2.感光元件配置

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_auto_exposure(1)
sensor.set_auto_gain(0, gain_db = 12)
sensor.set_auto
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值