The Python library that we will be using to communicate with our display is called py-gaugette and it was created by Guy Carpenter, who has kindly given me permission to use it. The process of installing py-gaugette is quite complicated because it has a lot of dependencies (ie: software that it depends on)... Because it is complicated I have made a simple script to automate the entire process for us. But before we can download and install it we will need to do a few simple commands and modifications. Lets get going.
1) Boot up your Raspberry Pi and login. There will be no need to start up the desktop - all of the stuff we need to do can be accomplished in the terminal!
sudo apt-get install git-core
In order to make our SPI pins usable we need to edit the blacklist text file so that it doesn't turn them off when the Pi starts up. This is really easy to do!
To access the text file we will need to use this command:
sudo nano /etc/modprobe.d/raspi-blacklist.conf
blacklist spi-bcm2708
# blacklist spi-bcm2708
Now exit and save by pressing ctrl+x and when it prompts you whether you want to save press y and then enter...
Finally there's one last step to make sure the I2C kernel modules are loaded at boot. In the nano text editor open the following file as root with sudo:
sudo nano /etc/modules
Make sure the following two lines are listed in the file, add them if they are not:
i2c-bcm2708
i2c-dev
Then save and exit the editor just like you did for the previous file.
4) The Pi needs to reboot for these additions to take effect so you can do with this command:
sudo reboot
We can now grab that all-in-one script that I mentioned earlier! It is available in my GitHub repository and so you can download it on to your Pi with this command:
git clone https://github.com/the-raspberry-pi-guy/OLED
cd OLED
sh OLEDinstall.sh
And that is it! Everything we need should now be installed - including the Python examples that I have included. Lets have a look at those and actually get our display to do something!
Text editor powered by tinymce.