例程讲解-02-read_adc读取ADC

# 读取ADC例子
#
# 这个例子展示了如何使用OpenMV的ADC

import time
from pyb import ADC

adc = ADC("P6") # Must always be "P6".

while(True):
    # ADC 12-bits 精度,4096个值
    print("ADC = %fv" % ((adc.read() * 3.3) / 4095))
    time.sleep_ms(100)

星瞳科技OpenMV官方中文文档函数讲解:

results matching ""

    No results matching ""