Skip to content

HWHardsoft/Display_Shield_RPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Display_Shield_RPI

This smart OLED shield will extend your Raspberry Pi or Arduino with a grafic OLED display, 3 buttons und 3 additional LEDs. The shape fits exactely in our RasPiBox Open, RasPiBox Zero and ArduiBox Open din rail enclosure sets, but you can use it without these enclosure kits too.

My image

Website

You will find more information about the Shield and the latest version of the code at https://www.hwhardsoft.de/english/projects/display-shield/

Electrical connection to Raspberry Pi

My image

Installation

Before using the library you will need to make sure you have a few dependencies installed. Connect to your device using SSH and follow the steps below.

I2C

First you have to enable the I2C port of the Raspberry PI:

sudo raspi-config
--> 5 Interfacing Options
--> P5 I2C
--> Would you like the ARM I2C interface to be enabled? --> Yes
sudo reboot

Now you have to install the I2C tools:

sudo apt-get install i2c-tools -y

Now you can test the I2C interface:

i2cdetect -y 1

My image

0x3C is the address of the SH1106 controller and 0x20 is the address of the MCP23008

Install Python3, PIP3 ...

Now you have to install Python3, PIP3, some dependencies and the luma library for SH1106 display controller:

sudo apt install python3-dev python3-pip libfreetype6-dev libjpeg-dev buildessential libopenjp2-7 libtiff5
sudo -H pip3 install --upgrade luma.oled

MCP23008

For the MCP23008 we have to install the smbus library too:

sudo pip3 install smbus

Install the demo code from GITHUB

Now to download and install the demo code for the display shield, execute the following commands:

cd ..
git clone https://github.com/hwhardsoft/Display_Shield_RPI.git
cd Display_Shield_RPI

to run the demo enter for the standard version:

sudo python3 display_shield.py

Press the 3 buttons to view different screens!

License

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.