GithubHelp home page GithubHelp logo

adafruit / adafruit_nokia_lcd Goto Github PK

View Code? Open in Web Editor NEW
98.0 98.0 47.0 25 KB

Python library for the using the Nokia 5110/3310 monochrome graphic LCD with a Raspberry Pi or Beaglebone Black.

License: MIT License

Python 100.00%

adafruit_nokia_lcd's Introduction

adafruit_nokia_lcd's People

Contributors

choffee avatar makermelissa avatar tdicola avatar xspager 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

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

adafruit_nokia_lcd's Issues

"RuntimeError: Could not determine platform" for Intel Edison

I'm trying to use an adapted script to power a Nokia 5110 on an Intel Edison (Yocto Poky running on Sparkfun blocks not Arduino). The script is basically shapes.py with the following configuration:

# Edison hardware SPI config:
#DC = 36
#RST = 48
#SPI_PORT = 5
#SPI_DEVICE = 1

# Edison software SPI config:
SCLK = 10
DIN = 11
DC = 36
RST = 48
CS = 23

But it fails on line 28:

>>> disp = LCD.PCD8544(DC, RST, SCLK, DIN, CS)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-i686/egg/Adafruit_Nokia_LCD/PCD8544.py", line 60, in __init__
  File "build/bdist.linux-i686/egg/Adafruit_GPIO/GPIO.py", line 426, in get_platform_gpio
RuntimeError: Could not determine platform.

Line 60 in PCD8544.py is: self._gpio = GPIO.get_platform_gpio(). I note that your library is supposed to use mraa to identify platform. When I call mraa.getPlatformName() I get 'Intel Edison'...

Any idea what the problem is here?

If it helps:

root@edison:/usr/lib/python2.7# python platform.py
Linux-3.10.17-poky-edison+-i686-with-glibc2.0

error: no such file or directory

I am new to Raspberry Pi and Python, and this is my second project. I did everything exactly as it is written in Adafruit's tutorial (https://learn.adafruit.com/nokia-5110-3310-lcd-python-library), but the code only returns a runtime error:

pi@raspberrypi ~/Adafruit_Nokia_LCD/examples $ sudo python image.py
Traceback (most recent call last):
File "image.py", line 58, in
disp = LCD.PCD8544(DC, RST, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=4000000))
File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-0.7.1-py2.7.egg/Adafruit_GPIO/SPI.py", line 42, in init
self._device.open(port, device)
IOError: [Errno 2] No such file or directory

I don't really know what to do or even where to ask for help. I would be grateful if you could help me what to do.

Adafruit Tutorial missing a step for Raspberry Pi

The tutorial at https://learn.adafruit.com/nokia-5110-3310-lcd-python-library/usage
fails with a file not found error on the step running the line "sudo python setup.py install".

This is on a clean Raspbian image (the new version, supporting Pi 2).

I was able to figure out that it was missing the python-dev package, and get it working by executing "sudo apt-get install python-dev", then re-running that final line "sudo python setup.py install".

It would be great for newer users attempting to run the tutorials if you could add the step to install the python-dev package before the execution of "sudo python setup.py install".

LCD goes blank and file descriptor leak?

Hi,

I'm using this library on the Raspberry Pi. The main program is a Python daemon to control a programmable thermostat.

Sometimes the LCD goes blank without any apparent reason. The program is fully functional, the Python image saved as PNG is OK, but disp.image() and disp.display() seems to do nothing anymore.

Every 3 minutes - as a workaround - I re-initialize the LCD, using:

disp = LCD.PCD8544(...)
disp.begin(contrast=LCD_CONTRAST)
disp.clear()

This is effective in making the display working again, but I suffer from a file descriptor leakage: I can see an increasing number of N -> /dev/spidev0.0 into /proc/PID/fd/ and after about three days the program dies.

Is there a nice way to release the resources? Any hints on the blank LCD problem?

Thank you

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.