GithubHelp home page GithubHelp logo

pimoroni / scroll-phat-hd Goto Github PK

View Code? Open in Web Editor NEW
159.0 24.0 63.0 522 KB

Python library for Scroll pHAT HD

Home Page: https://shop.pimoroni.com/products/scroll-phat-hd

License: MIT License

Python 96.52% Makefile 0.09% CSS 0.34% HTML 0.31% Shell 2.74%
raspberry-pi led-matrix-displays led-display python python-library pypi-package

scroll-phat-hd's Introduction

Scroll pHAT HD https://shop.pimoroni.com/products/scroll-phat-hd

https://shop.pimoroni.com/products/scroll-hat-mini

17x7 pixels of single-colour, brightness-controlled, message scrolling goodness! This library will work with Scroll pHAT HD and Scroll HAT Mini.

Installing

Full install (recommended):

We've created an easy installation script that will install all pre-requisites and get your Scroll pHAT HD up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop, as illustrated below:

Finding the terminal

In the new terminal window type the command exactly as it appears below (check for typos) and follow the on-screen instructions:

curl https://get.pimoroni.com/scrollphathd | bash

Alternatively, on Raspbian, you can download the pimoroni-dashboard and install your product by browsing to the relevant entry:

sudo apt-get install pimoroni

(you will find the Dashboard under 'Accessories' too, in the Pi menu - or just run pimoroni-dashboard at the command line)

If you choose to download examples you'll find them in /home/pi/Pimoroni/scrollphathd/.

Manual install:

Library install for Python 3:

on Raspbian:

sudo apt-get install python3-scrollphathd

other environments:

sudo pip3 install scrollphathd

Library install for Python 2:

on Raspbian:

sudo apt-get install python-scrollphathd

other environments:

sudo pip2 install scrollphathd

Development:

If you want to contribute, or like living on the edge of your seat by having the latest code, you should clone this repository, cd to the library directory, and run:

sudo python3 setup.py install

(or sudo python setup.py install whichever your primary Python environment may be)

In all cases you will have to enable the i2c bus.

Alternative Libraries

Documentation & Support

Unofficial / Third-party libraries

scroll-phat-hd's People

Contributors

ali1234 avatar andypiper avatar brentajones avatar chr15murray avatar dependabot[bot] avatar dglaude avatar fortoffee avatar gadgetoid avatar helgibbons avatar iamsrp avatar lindseyb avatar marginalhours avatar mrgjones avatar paolopal avatar pbpraha avatar raspberrycoulis avatar roguem avatar sandyjmacdonald avatar smdjeff avatar snarlistic avatar tiziano88 avatar tomnz avatar wild4gadgets avatar willdolezal avatar

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  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

scroll-phat-hd's Issues

Dead Led row, but only sometimes

Hi, I have some problems with my scrollphatHd, when I start a script, all is good, but after a few minutes, a row of leds stop working

I have tried to use different scripts from the example folder,

The worst is switl.py... the dead row showed up at start,

Any ideas what to do??

StoppableThread' object has no attribute 'isAlive'

Traceback (most recent call last):
  File "/home/kristn/.local/lib/python3.9/site-packages/flask/app.py", line 2095, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/kristn/.local/lib/python3.9/site-packages/flask/app.py", line 2080, in wsgi_app
    response = self.handle_exception(e)
  File "/home/kristn/.local/lib/python3.9/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/kristn/.local/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
    self.try_trigger_before_first_request_functions()
  File "/home/kristn/.local/lib/python3.9/site-packages/flask/app.py", line 1570, in try_trigger_before_first_request_functions
    self.ensure_sync(func)()
  File "/usr/local/lib/python3.9/dist-packages/scrollphathd/api/http.py", line 168, in start_background_thread
    api_thread.start()
  File "/usr/local/lib/python3.9/dist-packages/scrollphathd/api/stoppablethread.py", line 13, in start
    if not self.isAlive():
AttributeError: 'StoppableThread' object has no attribute 'isAlive'

This error occurs after running the examples/web-api.py and opening the index page

Support inverse text

At the moment, the function for drawing characters supports only white pixels on black background: it sets all pixels in the character bounding box. As it is, this makes it impossible to draw inverse chars with dark pixels against a white background. It would be useful to also allow inverse chars.

Update "Getting Started" Pimoroni Page with Github Link

The Getting Started page on Pimoroni's website has users run the following command:

curl https://get.pimoroni.com/scrollphathd | bash

This file does not appear to be at the same version as the github repo. This is evidenced in examples such as, "twitter-hashtag.py". The website's version still uses the deprecated Tweepy parameter syntax async=True, while the github repo uses the updated syntax is_async=True.

Is there any way for the website to instruct users to pull from the github instead? Or update the install script to do so?

Twitter example application not working...

I believe I have configure the example tweet application correctly with apps.twitter.com keys, however nothing is displayed on the device when I post tweets with the hashtag added to the script. All I ever see is an occasional four dots scroll across the screen. Any help would be appreciated.

Malformed and swapped chars 'à' & 'á' in font5x7

The characters 0xe0 'à' & 0xe1 'á' in font5x7 are swapped and malformed.

Char 0xe0 is currently 'á' and should be 'à', and is missing the first column.
Char 0xe1 is currently 'à' and should be 'á', and is also missing the first column.

0xe0
Current    Should be
  #          #
 #            #
###          ###
   #            #
####         ####
   #        #   #
####         ####

0xe1
Current    Should be
#              #
 #            #
###          ###
   #            #
####         ####
   #        #   #
####         ####

Port samples from Scroll pHAT repo

I've ported the local-weather.py sample from the scroll pHAT repo. Been meaning to do a pull request but would it be worth porting all of them? It's the only sample that I know of that's missing. Are there any others?

Examples with fonts broken

Hi,
I ran fine with all examples and my own code until running a dist-upgrade on my raspberry zero w yesterday. Now all examples (and my own code) don't show anything on the LEDs and run without any error or warning.
What kind of information do you need for debug? (And preferrably how do I get them :) )

example:twitter-hashtag wrapping error

there appears to be a wrapping error.

after the scrolling tweet has completed, the '>>>>>' from the beginning of the string is wrapped and then gets cleared from the scrollphat. seems to be some buffer length problem?

90 and 270 degree rotations don't work properly.

Seems that the display is still treated as 7 pixels high and 17 wide.

Test case:

#!/usr/bin/env python

import time
import signal
import math

import scrollphathd
from scrollphathd.fonts import font5x5


while True:
    str_hours = time.strftime("%H")
    scrollphathd.rotate(90) # or 270
    scrollphathd.clear()
    scrollphathd.write_string(str_hours, x=0, y=0, font=font5x5, brightness=0.02)
    scrollphathd.show()
    time.sleep(0.1)

"import scrollphathd as sphd" error

Hi!

I was importing the scrollphathd library in Pi Zero W.

l founding error this.

Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrollphathd as sphd
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/scrollphathd/is31fl3731.py", line 11, in <module>
    import smbus
ImportError: No module named 'smbus'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/scrollphathd/__init__.py", line 3, in <module>
    from . import is31fl3731
  File "/usr/local/lib/python3.5/dist-packages/scrollphathd/is31fl3731.py", line 13, in <module>
    if version_info[0] < 3:
NameError: name 'version_info' is not defined

Behave it the scroll-phat-hd is not present.

Library should gracefully fail if i2c communication can not be established when it is used for the first time (like if no display is connected).

Right now it fail with I2C error, some message that the support would like to see:

Make sure your Scroll pHAT HD is properly plugged.
Check your soldering and contact support with a picture if it still fail.

width and height of Scroll pHAT HD should rotate

The idea is that portable code (that use width and height) would work even if there is a rotation in place.

Even if discussed here and aggreed it would be a better choice, I am not sure I want to write the pull request for this as there is more than one way to do it with various impact depending on where to put the abstraction for that.

This code:

#!/usr/bin/env python

import scrollphathd as sphd

print(sphd.width)
print(sphd.height)
sphd.rotate(90)
print(sphd.width)
print(sphd.height)

This should display:

17
7
7
17

hashtagToScrollPhatHD to follow a user

Hello,

This is not a real issue since the code is working to follow an hashtag; It's more an upgrade request.
Is it possible to make hashtagToScrollPhatHD to display Tweets from a specific user (knowing its ID or username)? i.e. instead of tracking hashtag, follow the tweets from a specific user (by username or ID).
Did some experiments but couldn't get it working.

Support GPIO Extender by adding pigpio

I'd love to be able to run a full python IDE while creating my projects. With the GPIO extender tool, I can do just that! However, I don't think this library uses pigpio which is what the extender uses. Can you point me in the right direction as to how to add support?

add license info

Unable to find any licensing information in the readme or root of the repository.

Graph example not working

It looks to me like the graph.py example is not working:

pi@raspberrypi:~/Pimoroni/scrollphathd/examples $ ./graph.py 

Scroll pHAT HD: Graph

Displays a graph with random values.

Press Ctrl+C to exit!


Traceback (most recent call last):
  File "./graph.py", line 28, in <module>
    scrollphathd.set_graph(values, low=0, high=50, brightness=0.1)
  File "/usr/lib/python2.7/dist-packages/scrollphathd/is31fl3731.py", line 254, in set_graph
    value = values[p_x]
IndexError: list index out of range

flask required?

So your setup file only calls out numpy but you have a file buried in your library (api/http.py) that requires flask to be installed. Suggest, you move it out to the examples. It seems silly to have a large requirement like flask for an lcd matrix.

When I tried to run hello-world.py it complained about flask even though I am not doing any http/internet stuff.

pi@terra examples $ ./hello-world.py 
Traceback (most recent call last):
  File "./hello-world.py", line 6, in <module>
    import scrollphathd
  File "/usr/local/lib/python2.7/dist-packages/scrollphathd/__init__.py", line 2, in <module>
    from .api.http import start_background_thread, scrollphathd_blueprint
  File "/usr/local/lib/python2.7/dist-packages/scrollphathd/api/http.py", line 21, in <module>
    raise ImportError("flask must be installed in order to use the api. Install with pip install flask")
ImportError: flask must be installed in order to use the api. Install with pip install flask

I would also argue for numpy to be removed since it takes forever for numpy to compile on a Pi Zero, but ...

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.