26 lines
523 B
Python
26 lines
523 B
Python
from maix import audio, time, app,gpio
|
|
|
|
|
|
# button1 = gpio.GPIO("ADC", gpio.Mode.IN)
|
|
button3 = gpio.GPIO("A26", gpio.Mode.IN) # 可用
|
|
button2 = gpio.GPIO("A16", gpio.Mode.IN)
|
|
#设置低电平
|
|
from maix.peripheral import adc
|
|
channel = 0
|
|
res_bit = adc.RES_BIT_12
|
|
_adc_obj = adc.ADC(channel, res_bit)
|
|
|
|
|
|
while not app.need_exit():
|
|
# print(f"b1: {button1.value()}")
|
|
|
|
print(f"b2: {button2.value()}")
|
|
|
|
# print(_adc_obj.read_vol())
|
|
print(f"b3: {button3.value()}")
|
|
time.sleep_ms(50)
|
|
|
|
# time.sleep_ms(1000)
|
|
|
|
|