Git Product home page Git Product logo

Comments (5)

sahmad98 avatar sahmad98 commented on July 30, 2024

Code is wrong at time.sleep(ms/1000), is ms previously defined. Check for
that because sleep function takes int.

On Saturday, March 14, 2015, Ali Yousuf [email protected] wrote:

In a freshly installed Debian (2015-03-01) on Beaglebone Black Rev A6A,
the encoder_test.py example shows this error:

Traceback (most recent call last):
File "encoder_test.py", line 24, in
run(setup, loop)
File "/usr/local/lib/python2.7/dist-packages/PyBBIO-0.9.3-py2.7-linux-armv7l.egg/bbio/bbio.py", line 60, in run
loop()
File "encoder_test.py", line 22, in loop
delay(1000)
File "/usr/local/lib/python2.7/dist-packages/PyBBIO-0.9.3-py2.7-linux-armv7l.egg/bbio/common.py", line 36, in delay
time.sleep(ms/1000.0)
TypeError: must be string, not int
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(_targs, *_kargs)
File "/usr/local/lib/python2.7/dist-packages/PyBBIO-0.9.3-py2.7-linux-armv7l.egg/bbio/bbio.py", line 21, in bbio_cleanup
for cleanup in ADDITIONAL_CLEANUP:
TypeError: must be string, not int
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(_targs, *_kargs)
File "/usr/local/lib/python2.7/dist-packages/PyBBIO-0.9.3-py2.7-linux-armv7l.egg/bbio/bbio.py", line 21, in bbio_cleanup
for cleanup in ADDITIONAL_CLEANUP:
TypeError: must be string, not int

Reply to this email directly or view it on GitHub
#58.

Saleem Ahmad

from pybbio.

 avatar commented on July 30, 2024

I have not changed anything in the example. It is in integer already. The error says "must be String" -- I'm also confused at this.
Here is the code

#!/usr/bin/env python
"""
 encoder_test.py
 Rekha Seethamraju

 An example to demonstrate the use of the eQEP library
 for PyBBIO.

 This example program is in the public domain.
"""
from bbio import *
from bbio.libraries.RotaryEncoder import RotaryEncoder

encoder = RotaryEncoder(RotaryEncoder.EQEP2b)

def setup():
  encoder.setAbsolute()
  encoder.zero()

def loop():
  print "encoder position : \t"+encoder.getPosition()
  delay(1000)

run(setup, loop)

from pybbio.

alexanderhiam avatar alexanderhiam commented on July 30, 2024

Hmm... this is an odd one. Seems that either the RotaryEncoder library itself or the sysfs C extension it uses to read/write the eQEP driver files is the source of the problem (time.sleep most certainly doesn't take a string!). I'm looking into it...

from pybbio.

KirkAtWork avatar KirkAtWork commented on July 30, 2024

Just letting you know I'm having the exact same problem with the same code
I'm on Beaglebone Black Rev C. Version is:
Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux

Any new ideas on this yet? I'm stuck

from pybbio.

alexanderhiam avatar alexanderhiam commented on July 30, 2024

OK got it, I was missing a type check in a C extension, and the TypeError was popping up at a weird time.

from pybbio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.