Example explanation-02-dac_write DAC output

# DAC 控制例子
#
# 这个例子展示了如何使用板上的DAC引脚输出。

import time
from pyb import DAC

dac = DAC("P6") # 必须是“P6”。

while(True):
    # DAC 有 8-12 bits 精度 (默认 8-bits).
    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)

Singtown Technology OpenMV official Chinese document function explanation:

results matching ""

    No results matching ""