0

Im having trouble reading the analog value of my Arduino using pyfirmata. Every time I ask to read the value of ('a:0:i) it will always return a random set of numbers, regardless of whether I have an analog pin plugged in or not.

import pyfirmata

board = pyfirmata.Arduino('COM4')

it = pyfirmata.util.Iterator(board)
it.start()

analog_read = board.get_pin('a:0:i')

while True:
    print(analog_read.read())
    time.sleep(2)

The output will return

0.3255
0.3255
0.3294
#and up

0 Answers0