You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a potentiometer to get a value between 0 and 1. I am able to print it in the console but the type of the data is 'NoneType'. Would it be possible to change this data type to a 'float' so that I can save it in a variable? Here is my code for now:
from pyfirmata import Arduino
import pyfirmata
import time
port = "COM3"
board = Arduino(port)
List = []
pin = board.get_pin('a:0:i')
it = pyfirmata.util.Iterator(board)
it.start()
print("Start reading")
for i in range(3):
analog_value = pin.read()
print(analog_value)
List.append(analog_value)
time.sleep(0.1)
del List[0]
print(List)
The text was updated successfully, but these errors were encountered:
I am using a potentiometer to get a value between 0 and 1. I am able to print it in the console but the type of the data is 'NoneType'. Would it be possible to change this data type to a 'float' so that I can save it in a variable? Here is my code for now:
The text was updated successfully, but these errors were encountered: