ADC
— 模拟信号转数字信号¶
使用示例¶
1 2 3 4 5 6 7 8 9 10 11 | # coding=utf-8
# This is a sample Python script.
from driver import ADC
print("-------------------start adc test--------------------")
adc = ADC()
adc.open("ADC2")
value = adc.read()
print(value)
adc.close()
print("-------------------end adc test--------------------")
|
配置信息¶
board.jon 语法和功能的详细配置项信息请参考 BoardConfig — 硬件端口配置文件(board.json)详解 。
1 2 3 4 5 6 7 8 9 10 11 | {
"version": "1.0.0",
"io": {
"ADC2": {
"type": "ADC",
"port": 0,
"sampling": 12000000
}
},
"debugLevel": "DEBUG"
}
|