Want to build this project?
View Parts

 

20121126_020012.jpg

I followed Adafruit's great Drive a 16x2 LCD with the Raspberry Pi tutorial using:

  • 16x2 character LCD16x2 character LCD
  • Adafruit Pi CobblerAdafruit Pi Cobbler
  • breadboardbreadboard
  • potentiometerpotentiometer

 

However, Fergus Byrne identified a problem with the Adafruit_CharLCD library for the Rev 2.0 Pi as GPIO 21 and 27 have changed.  It turned out the simplest fix is to switch the pin numbering scheme to that of the physical header rather than the Broadcom SoC.  Until Adafruit accepts my pull request, I'd recommend using Adafruit_CharLCD from my repository if you have a Rev 2.0 Pi.

 

After sorting that out, I wrote a Python script to display tweets for a given hashtag (display-hashtag.py) which can be found in my tweetypi GitHub repo.  I use Python Twitter Tools by Mike Verdone to search Twitter.

 

Follow these instructions to install the hashtag display:

pi@raspberrypi ~ $ sudo pip install twitter

 

pi@raspberrypi ~ $ mkdir python

 

pi@raspberrypi ~ $ cd python

 

pi@raspberrypi ~/python $ git clone https://github.com/pdp7/Adafruit-Raspberry-Pi-Python-Code.git

Cloning into 'Adafruit-Raspberry-Pi-Python-Code'...

remote: Counting objects: 185, done.

remote: Compressing objects: 100% (117/117), done.

remote: Total 185 (delta 83), reused 158 (delta 56)

Receiving objects: 100% (185/185), 55.25 KiB, done.

Resolving deltas: 100% (83/83), done.

 

pi@raspberrypi ~/python $ git clone https://github.com/pdp7/tweetypi.git

Cloning into 'tweetypi'...

remote: Counting objects: 13, done.

remote: Compressing objects: 100% (10/10), done.

remote: Total 13 (delta 2), reused 8 (delta 2)

Unpacking objects: 100% (13/13), done.

 

pi@raspberrypi ~/python $ cd tweetypi

The only required argument for display-hashtag is the hashtag. The usual '#' hashtag prefix should be omitted from the argument as it is added by the Python code. The defaults assume 16x2 char LCD:

sudo ./display-hashtag bears

Here's a video clip of it running:

 

 

The HashTagDisplay class supports character LCD from 16x1 up to 20x4.  Here would be the arguments for 20x4 LCD:

sudo ./display-hashtag --verbose --cols 20 --rows 4 --delay 3 bears

 

20121125_232158.jpg

Video clip of 20x4 display:

 

 

Cheers,

Drew

 

 

element14
Product Name*DescriptionBuy All PartsBuy All Parts
Raspberry Pi Model B with SD CardRaspberry Pi Model B with SD CardRaspberry Pi model B and 8GB SD Card with NOOBS preinstalled
Optical MouseOptical MouseBasic USB optical mouse
Raspberry Pi Power SupplyRaspberry Pi Power Supply120-240v to 5V power supply with micro USB connector
KeyboardKeyboardBasic USB keyboard
16x2 character LCD16x2 character LCD16x2 character monochrome LCD
10k trimmer potentiometer10k trimmer potentiometer10k ohm, single turn trimmer potentiometer
Adafruit Pi CobblerAdafruit Pi CobblerGPIO breakout kit for Raspberry Pi
BreadboardBreadboardBasic breadboard with 830 connection points
Jumper wire bundleJumper wire bundleJumper wires for use on breadboard

 

*Products and resources listed are listed to help members build their own Pi Projects. They are suggestions and listed for educational purposes. For substitutions of any parts, please post a question asking the original author.