Play With Raspberry ZERO PHat

by masteruan in Circuits > Raspberry Pi

3606 Views, 42 Favorites, 0 Comments

Play With Raspberry ZERO PHat

Raspberry Pi Zero & piHat.png
PC050088.JPG
PC050086.JPG
PC050076.JPG
PC050073.JPG
ezgif.com-video-to-gif.gif

Raspberry Pi zero is a smallest version of Raspberry Pi. The Raspberry Pi is not a comestible kind, but is a Microcomputer. A single board computer that have CPU, RAM, HD, all connections like USB, HDMI etc.

I have also discovered a small led matrix 11x5 by Pimoroni, the pHat. This is a small and pretty led matrix that with this little pretty Raspberry Pi, the Raspberry Pi zero, make a very kindly object. A led scrolling led matrix, that you can program in Python.

I show you where to buy the Raspberry Pi, where buy the pHat, and how to install the library and the code for work with the pHat matrix.

On Amazon you can buy the

1. pHat

or Unicorn Hat

2. Raspberry Pi

The Raspberry Pi Zero is available only on Pimoroni

Raspberry Pi Zero

Download the PHat Library

Z4FUp.png
spi-menu.png

After the soldering step, you can connect the pHat to your Raspberry Pi zero.

In the Terminal window, type:

sudo raspi-config

put the password (default is raspberry)

1. Go to Advanced Options

2. Select i2c

3. Enable the i2c port

Install the library on Python 3

Open a Terminal and type:

sudo pip3 install scrollphat

or

sudo apt-get install python3-scrollphat

Install the library on Python 2

Open a Terminal and type:

sudo pip2 install scrollphat

or

sudo apt-get install python-scrollphat

Connect the PHat and Try the Code

PC050075.JPG
PC050084.JPG
PC050074.JPG

You can download the three files on your Raspberry Pi. The graph file generate a random lines on your pHat, the tempCpu, show the CPU temperature of your Raspberry Pi zero, and the meteoShare.py show the local meteo condition.

If you want use meteo file you must install the pyown library by terminal:

sudo pip install pyown

After you must provide a valid API key by using pyown library. The weather service you're going to use in this resource is called OpenWeatherMap. It's a completely free service, and has an easy-to-use API. You're going to need your own account though, so click on the link to go to the website: http://openweathermap.org

Try to Make the PHat Sparkle

ezgif.com-video-to-gif-2.gif
PC050089.JPG
PC050087.JPG

In the Terminal window, go to the same folder where are graph.py file, and type:

python graph.py

or

python3 cpuTemp.py

or

python meteoShare.py

See the result!


See other examples on GitHub