I’m running the below code. It works for a brief moment then fails with the error “[Errno 5] Input/output error”
import time import easygopigo3 as easy gpg = easy.EasyGoPiGo3() my_distance_sensor = gpg.init_distance_sensor() while True: # Directly print the values of the sensor. print("Distance Sensor Reading (mm): " + str(my_distance_sensor.read_mm()))
When i try to rerun the code after the initial error i then get the error
" print("Distance Sensor Reading (mm): " + str(my_distance_sensor.read_mm()))
AttributeError: ‘NoneType’ object has no attribute ‘read_mm’
I tried detaching the cable from 12c and reattached it again which got it to work for a brief moment but then failed again. Any suggestions on how to solve this would be greatly appreciated.