我试图读取按钮的模拟引脚。但无法读取。总是出现此错误。
我的代码:
import pyfirmata
import time
from pyfirmata import util
port = "COM4" # port number
board = pyfirmata.Arduino(port)
it = util.Iterator(board)
it.start()
pin_redLed = 8 # red LED pin number
board.analog[11].enable_reporting()
while True :
print (board.analog[11].read())
time.sleep(1)
1条答案
按热度按时间b0zn9rqh1#
我解决了: