I need, to periodically update speed of my motor. generally like this:
cc=1
while cc==1:
file = open("/home/pi/M0.txt", "r")
speedM0=file.read()
file.close()
new_target=int(speedM0)*100000
tic.set_target_speed(new_target)
time.sleep(0.02)
It doesn’t work correctly. It crashes randomly with:
File "/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py", line 497, in i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
IOError: [Errno 121] Remote I/O error