Skip to content

Can't Set Encoder Frequency Using Python3 #299

@pdp7

Description

@pdp7

From the Adafruit forum:
https://forums.adafruit.com/viewtopic.php?f=49&t=145110&p=716829#p716829

Test:

from Adafruit_BBIO.Encoder import RotaryEncoder, eQEP2

test_encoder = RotaryEncoder(eQEP2)

# Enable
test_encoder.enable()

# Attempt to set frequency
test_encoder.frequency = 2000

print(test_encoder.frequency)

# Disable
test_encoder.disable()

Error:

ebian@beaglebone:~$ python encoder_test.py
2000
debian@beaglebone:~$ python3 encoder_test.py
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "encoder_test.py", line 9, in <module>
    test_encoder.frequency = 2000
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_BBIO/Encoder.py", line 355, in frequency
    self._eqep.node.period = str(period)
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_BBIO/sysfs.py", line 93, in __setattr__
    fp.write(val)
OSError: [Errno 22] Invalid argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy