dac_write.py

# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2023 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# DAC控制示例
#
# 此示例展示了如何使用OpenMV摄像头板载的DAC引脚输出。

import time
from pyb import DAC

dac = DAC("P6")  # 必须始终为“P6”。

while True:
    # DAC具有8-12位分辨率(默认8位)。
    for i in range(256):
        dac.write(i)
        time.sleep_ms(20)
    for i in range(256):
        dac.write(255 - i)
        time.sleep_ms(20)

results matching ""

    No results matching ""