I'm trying to use the encoders via Python:

from Adafruit_BBIO.Encoder import RotaryEncoder, eQEP2
import time


# Instantiate the class to access channel eQEP2, and initialize
# that channel
myEncoder = RotaryEncoder(eQEP2)


# Get the current position


while True:
    cur_position = myEncoder.position
    print(cur_position)
    time.sleep(1)

But I get the following error:

Traceback (most recent call last):
  File "./eQEP.py", line 8, in <module>
    myEncoder = RotaryEncoder(eQEP2)
  File 
"/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/Encoder.py"
, line 195, in __init__
    self._eqep = _eQEP.fromdict(_eQEP_DEFS[eqep_num])
  File 
"/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/Encoder.py"
, line 126, in fromdict
    return cls(**df)
  File 
"/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/Encoder.py"
, line 150, in __init__
    self.node = Node(sys_path)
  File 
"/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/sysfs.py"
, line 78, in __init__
    self.__dict__.update(dict.fromkeys(listdir(self._path_)))
FileNotFoundError: [Errno 2] No such file or directory: 
'/sys/devices/platform/ocp/48304000.epwmss/48304180.eqep'


I'm running a current image:

cat /ID.txt 
BeagleBoard.org Debian Buster IoT Image 2020-04-06
name -a
Linux pocket 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 
2020 armv7l GNU/Linux

Any suggestions on how to make it work?

--Mark



-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/de74f762-06c9-4a26-867f-45c8f178e7d1o%40googlegroups.com.

Reply via email to