Code Monkey home page Code Monkey logo

adafruit_python_led_backpack's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_python_led_backpack's Issues

I want to make a PR to extend character set for SevenSegment.py

Hi all,

I have a working version of SevenSegment.py in my local branch that adds a variety of new characters to the seven segment display driver. Its backwards compatible, doesn't add any significant overhead (loading on my RPi0W still takes < 150 microseconds) and works correctly when inverted. Also I added some comments about the logic behind the driver just to help the next reader be informed about how it works.

Do I have to do anything special to submit the PR? I'm getting a 403 from my git push.

Josh

Can't subclass SevenSegment?

I'm new to python so hopefully it's just a 'me' thing...

I've tried subclassing SevenSegment, and always get an error about expecting 2 arguments but got 3...

Basically I've just done:


from Adafruit_LED_Backpack import SevenSegment

class ClockDisplay(SevenSegment):

    def __init__(self, **kwargs):
        super(ClockDisplay, self).__init__(**kwargs)

and that seems to fail. (this is from memory, i'll double check the code when i get home - i did have some other functions too, just trying to simplify the issue as much as i can)

What am I doing wrong?
I'd like to subclass it so that I can extend some of the functionality, and I'm hoping once I get it write to put a pull request in, but it's hard when i can't get this bit to work

If i run from the dev folder, and use 'from SevenSegment import SevenSegment', the code seems to work...

5V incompatible

When I connect the red LED to 3.3V, sevensegment_test.py runs perfectly. However the display is too dim using the raspberry pi model 3, so I need 5V. When I connect to 5V, I get a input/output error. in write_i2c_block_data

No module named Adafruit_LED_Backpack

Hello,

Recently, I just bought a 4 Digit-7Segment Display from Adafruit. After connecting the LED pack with my Raspberry Pi 2 I just wanted to start an example code, which is part of the official Code package. Unfortunately, I was not able to run the example Code due to an error, which I could not solve on my one. I would really appreciate, if someone give me a hint or an advise how I can handle this.

pi@raspberrypi ~ $ ls
Adafruit_Python_LED_Backpack Documents python_games Scratch
Desktop Downloads Schrott
pi@raspberrypi ~ $ cd Adafruit_Python_LED_Backpack
pi@raspberrypi ~/Adafruit_Python_LED_Backpack $ ls
Adafruit_LED_Backpack examples ez_setup.py LICENSE README.md setup.py
pi@raspberrypi ~/Adafruit_Python_LED_Backpack $ cd examples
pi@raspberrypi ~/Adafruit_Python_LED_Backpack/examples $ ls
alphanum4_test.py ex_7segment_clock.py sevensegment_test.py
bicolor_bargraph24_test.py matrix8x16_test.py
bicolor_matrix8x8_test.py matrix8x8_test.py
pi@raspberrypi ~/Adafruit_Python_LED_Backpack/examples $ sudo python ex_7segment_clock.py
Traceback (most recent call last):
File "ex_7segment_clock.py", line 6, in
from Adafruit_LED_Backpack import SevenSegment
ImportError: No module named Adafruit_LED_Backpack
pi@raspberrypi ~/Adafruit_Python_LED_Backpack/examples $ ^C

Thank you very much in advance!

error in print_number_str() when executed by python3

  • Platform/operating system (i.e. Raspberry Pi with Raspbian operating system,
    Windows 32-bit, Windows 64-bit, Mac OSX 64-bit, etc.): INSERT PLATFORM/OPERATING
    SYSTEM HERE

Rasberry Pi with Raspbian
4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 armv7l GNU/Linux

  • Python version (run python -version or python3 -version): INSERT PYTHON
    VERSION HERE

Python 3.4.2

  • Error message you are receiving, including any Python exception traces: INSERT
    ERROR MESAGE/EXCEPTION TRACES HERE
    *

$ python3 ./AlphaNumTest.py
Traceback (most recent call last):
File "./AlphaNumTest.py", line 101, in
display.print_number_str("22.", justify_right=False)
File "/usr/local/lib/python3.4/dist-packages/Adafruit_LED_Backpack-1.8.1-py3.4.egg/Adafruit_LED_Backpack/AlphaNum4.py", line 183, in print_number_str
TypeError: translate() takes exactly one argument (2 given)

  • List the steps to reproduce the problem below (if possible attach code or commands
    to run): LIST REPRO STEPS BELOW

Code executes fine with python2. I have not found a correction for python3.

Need to change SDA pins

Everything is working great when I use SDA1/SCL1 (pins NUMBERS 3/5 GPIO 8/9 RPI 3 model B) but I need to use other pins instead.

I thought on using pin NUMBERS 27/28 SDA0/SCL0.

Can I?
please help.

thanks!

BicolorMatrix8x8 example code error line 32

Adafruit_Python_LED_Backpack/examples/bicolor_matrix8x8_test.py

line 32
currently:

display = Matrix8x8.Matrix8x8(address=0x74, busnum=1)

should read:

display = BicolorMatrix8x8.BicolorMatrix8x8(address=0x74, busnum=1)

Thought my display was broken when I changed the first BicolorMatrix8x8 but missed the second.

Won't work

Hey,
I'm trying to run the following with a Raspberry pi 2 model B:

pi@rbp2biancm1:~/Adafruit_Python_LED_Backpack/examples $ sudo python bicolor_matrix8x8_test.py

Traceback (most recent call last):
File "bicolor_matrix8x8_test.py", line 35, in
display.begin()
File "build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/HT16K33.py", line 53, in begin
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 127, in writeList
File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 274, in write_i2c_block_data
IOError: [Errno 5] Input/output error

But there are no files nor subfolders in build/bdist.linux-armv7

Can you please fix this ?

Not able to install with the setup.py/ez_setup.py

Hello I have issues installing the libraries with the setup.py and ez_setup.py scripts. I have installed all the necessary dependencies that were documented in the readme but I`m still unable to install the LED Backpack:

root@TEST-RPi:/home/pi/Adafruit_Python_LED_Backpack# apt-get install build-essential python-dev python-smbus python-imaging git
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.3).
git is already the newest version (1:2.11.0-3+deb9u3).
python-dev is already the newest version (2.7.13-2).
python-imaging is already the newest version (4.0.0-4).
python-smbus is already the newest version (3.1.2-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@TEST-RPi:/home/pi/Adafruit_Python_LED_Backpack# python setup.py install
Extracting in /tmp/tmpedyF2X
Traceback (most recent call last):
File "setup.py", line 4, in
use_setuptools()
File "/home/pi/Adafruit_Python_LED_Backpack/ez_setup.py", line 128, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/home/pi/Adafruit_Python_LED_Backpack/ez_setup.py", line 108, in _do_download
_build_egg(egg, archive, to_dir)
File "/home/pi/Adafruit_Python_LED_Backpack/ez_setup.py", line 57, in _build_egg
with archive_context(archive_filename):
File "/usr/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/home/pi/Adafruit_Python_LED_Backpack/ez_setup.py", line 88, in archive_context
with get_zip_class()(filename) as archive:
File "/usr/lib/python2.7/zipfile.py", line 770, in init
self._RealGetContents()
File "/usr/lib/python2.7/zipfile.py", line 813, in _RealGetContents
raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file
root@TEST-RPi:/home/pi/Adafruit_Python_LED_Backpack# python ez_setup.py install
Extracting in /tmp/tmpFQnNJI
Traceback (most recent call last):
File "ez_setup.py", line 332, in
sys.exit(main())
File "ez_setup.py", line 329, in main
return _install(archive, _build_install_args(options))
File "ez_setup.py", line 46, in _install
with archive_context(archive_filename):
File "/usr/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "ez_setup.py", line 88, in archive_context
with get_zip_class()(filename) as archive:
File "/usr/lib/python2.7/zipfile.py", line 770, in init
self._RealGetContents()
File "/usr/lib/python2.7/zipfile.py", line 813, in _RealGetContents
raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file
root@TEST-RPi:/home/pi/Adafruit_Python_LED_Backpack#

I`m running the latest version of Raspbian on the Rpi, all dependencies are up to date.

Can you help me?

Thank you in advance!

Problems on RPi

Hey,

i got problems getting it running on raspberrypi. It writes "No File or Directory". i also cant get the "Image" module running. I removed that from the scripts.

here are my outputs:

pi@RPI02 ~ $ wget https://github.com/adafruit/Adafruit_Python_LED_Backpack/archive/master.zip
--2015-07-25 10:30:25--  https://github.com/adafruit/Adafruit_Python_LED_Backpack/archive/master.zip
Resolving github.com (github.com)... 192.30.252.130
Connecting to github.com (github.com)|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/adafruit/Adafruit_Python_LED_Backpack/zip/master [following]
--2015-07-25 10:30:32--  https://codeload.github.com/adafruit/Adafruit_Python_LED_Backpack/zip/master
Resolving codeload.github.com (codeload.github.com)... 192.30.252.145
Connecting to codeload.github.com (codeload.github.com)|192.30.252.145|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: `master.zip'

    [ <=>                                                                                                                                                     ] 26,231      --.-K/s   in 0.1s    

2015-07-25 10:30:36 (190 KB/s) - `master.zip' saved [26231]


pi@RPI02 ~ $ unzip -a master.zip
Archive:  master.zip
a6da0e5130ae23d5f50d0a22a9cb2a56ecc31298
   creating: Adafruit_Python_LED_Backpack-master/
 extracting: Adafruit_Python_LED_Backpack-master/.gitignore  [text]  
   creating: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/
  inflating: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/AlphaNum4.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/BicolorBargraph24.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/BicolorMatrix8x8.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/HT16K33.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/Matrix8x8.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/SevenSegment.py  [text]  
 extracting: Adafruit_Python_LED_Backpack-master/Adafruit_LED_Backpack/__init__.py  [empty] 
  inflating: Adafruit_Python_LED_Backpack-master/LICENSE  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/README.md  [text]  
   creating: Adafruit_Python_LED_Backpack-master/examples/
  inflating: Adafruit_Python_LED_Backpack-master/examples/alphanum4_test.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/examples/bicolor_bargraph24_test.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/examples/bicolor_matrix8x8_test.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/examples/matrix8x8_test.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/examples/sevensegment_test.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/ez_setup.py  [text]  
  inflating: Adafruit_Python_LED_Backpack-master/setup.py  [text]  


pi@RPI02 ~ $ cd Adafruit_Python_LED_Backpack-master/


pi@RPI02 ~/Adafruit_Python_LED_Backpack-master $ sudo python setup.py install 
running install
running bdist_egg
running egg_info
creating Adafruit_LED_Backpack.egg-info
writing requirements to Adafruit_LED_Backpack.egg-info/requires.txt
writing Adafruit_LED_Backpack.egg-info/PKG-INFO
writing top-level names to Adafruit_LED_Backpack.egg-info/top_level.txt
writing dependency_links to Adafruit_LED_Backpack.egg-info/dependency_links.txt
writing manifest file 'Adafruit_LED_Backpack.egg-info/SOURCES.txt'
reading manifest file 'Adafruit_LED_Backpack.egg-info/SOURCES.txt'
writing manifest file 'Adafruit_LED_Backpack.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
copying Adafruit_LED_Backpack/BicolorBargraph24.py -> build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
copying Adafruit_LED_Backpack/HT16K33.py -> build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
copying Adafruit_LED_Backpack/SevenSegment.py -> build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
copying Adafruit_LED_Backpack/__init__.py -> build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
copying Adafruit_LED_Backpack/AlphaNum4.py -> build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
copying Adafruit_LED_Backpack/Matrix8x8.py -> build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
copying Adafruit_LED_Backpack/BicolorMatrix8x8.py -> build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
copying build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack/BicolorBargraph24.py -> build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
copying build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack/HT16K33.py -> build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
copying build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack/SevenSegment.py -> build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
copying build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack/__init__.py -> build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
copying build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack/AlphaNum4.py -> build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
copying build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack/Matrix8x8.py -> build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
copying build/lib.linux-armv7l-2.7/Adafruit_LED_Backpack/BicolorMatrix8x8.py -> build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/BicolorBargraph24.py to BicolorBargraph24.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/HT16K33.py to HT16K33.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/SevenSegment.py to SevenSegment.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/AlphaNum4.py to AlphaNum4.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/Matrix8x8.py to Matrix8x8.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/BicolorMatrix8x8.py to BicolorMatrix8x8.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_LED_Backpack.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_LED_Backpack.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_LED_Backpack.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_LED_Backpack.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_LED_Backpack.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/Adafruit_LED_Backpack-1.5.0-py2.7.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing Adafruit_LED_Backpack-1.5.0-py2.7.egg
Removing /usr/local/lib/python2.7/dist-packages/Adafruit_LED_Backpack-1.5.0-py2.7.egg
Copying Adafruit_LED_Backpack-1.5.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adafruit-LED-Backpack 1.5.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/Adafruit_LED_Backpack-1.5.0-py2.7.egg
Processing dependencies for Adafruit-LED-Backpack==1.5.0
Searching for Adafruit-GPIO==0.9.3
Best match: Adafruit-GPIO 0.9.3
Processing Adafruit_GPIO-0.9.3-py2.7.egg
Adafruit-GPIO 0.9.3 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-0.9.3-py2.7.egg
Searching for spidev==3.0
Best match: spidev 3.0
Processing spidev-3.0-py2.7-linux-armv7l.egg
spidev 3.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/spidev-3.0-py2.7-linux-armv7l.egg
Finished processing dependencies for Adafruit-LED-Backpack==1.5.0


pi@RPI02 ~/Adafruit_Python_LED_Backpack-master $ python examples/bicolor_matrix8x8_test.py 
Traceback (most recent call last):
  File "examples/bicolor_matrix8x8_test.py", line 30, in <module>
    display = BicolorMatrix8x8.BicolorMatrix8x8()
  File "build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/BicolorMatrix8x8.py", line 40, in __init__
  File "build/bdist.linux-armv7l/egg/Adafruit_LED_Backpack/HT16K33.py", line 46, in __init__
  File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 66, in get_i2c_device
  File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 95, in __init__
IOError: [Errno 2] No such file or directory


pi@RPI02 ~/Adafruit_Python_LED_Backpack-master $ python --version
Python 2.7.3

Would be awesome if someone can help me. :)

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.