I am using an Adafruit RP2040 and have it set up with 2 Rotary encoders and a small display. When I start the program I can change the value on the display using the Rotary encoders, but as soon as I set the value via PC command the two Rotary encoders don't react anymore. I tried to close the instance with the pc but still nothing. I can reconnect the PC again after closing the instance and set the values via PC again, but no reactions from the Rotary encoders anymore until I restart the whole RP2040.
Is there a command I can use to make the RP2040 listen to the encoders again?
Here is the code I use to establish connection:
Code: Select all
import pyvisa
import board
import time
resources = rm.list_resources()
foundInstr = None
for iRes in resources:
if 'ASRL6' in iRes:
foundInstr = iRes
if foundInstr != None:
inst = rm.open_resource(foundInstr)
and here the code I use to set the value and read back the set value:
Code: Select all
inst.clear()
inst.write('250')
value = inst.read()
print(value)
Thank you very much for your help