import time,sensor, image, tv
from pyb import Pin, Timer
sensor.reset() # 复位并初始化传感器。
sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE
#设置图像色彩格式,有RGB565色彩图和GRAYSCALE灰度图两种
sensor.set_framesize(sensor.QQVGA)
# 50kHz pin6 timer2 channel1
light = Timer(2, freq=50000).channel(1, Timer.PWM, pin=Pin("P6"))
light.pulse_width_percent(100) # 控制亮度 0~100
while (True):
img = sensor.snapshot()
使用这个demo led扩展板画面一直闪烁 请教如何设置
使用扩展板的时候 如何屏蔽pwm引脚让扩展板常亮 不闪烁,或者能跟上相机的频率
如果闪烁的话,就寄回维修吧。
@kidswong999 扩展版点亮看起来是常亮 但到画面出现灯光闪烁 vin 5v供电,是p6设置频率的问题吗,请问能不能不设置频率直接点亮
不是频率的问题,占空比是100%,根本就一直是高电平。