Using a 2.2″ 176×200 ILI995 SPI LCD screen with Raspberry Pi

I want to use a very small LCD for a specific project and though the 2.2″ SPI LCD would be a good start. Ultimately I would like to have a touch screen, but couldn’t find one locally at the time.

So I purchased the following 2.2″ TFT LCD Screen for my Raspberry Pi 3 Model B. This LCD has a 176×200 resolution and connects to the Raspberry Pi, and Arduino’s via the SPI bus.  Serial Peripheral Interface (SPI) is used to communicate with various devices like LCD screens, SD Card readers, and some sensors over a serial bus.

 This tutorial will show you how to connect the  2.2″ SPI LCD to a Raspberry Pi 3 Model B. It should work on other Raspberry Pi models as well, though you might have to change the wiring layout a bit.

Right, let’s get started.

As you can see from the photo above, the LCD screen has a SD Card slot which can also be used, but you would need to solder some header pins to the PCB first.  For this tutorial I’m only going to connect to the LCD and send some data to it.

 

The header PINS are as follows:

VCC >> Connect to the Raspberry 3.3V (pin 1)
GND >> Connect to the Raspberry Ground (pin 9)
GND >> Leave Open
NC >> Leave Open
NC >> Leave Open
LED >> Connect to the Raspberry 3.3V (pin 6)
CLK >> Connect to the Raspberry SPI0 CLOCK (pin 23)
SDI >> Connect to the Raspberry SPI0 MOSI (pin 19)
RS >> Connect to the Raspberry GPIO 24 (pin 18)
RST >> Connect to the Raspberry GPIO 25 (pin 22)
CS >> Connect to the Raspberry SPI0 CSO / CE0 (pin 24)

I used the following reference image for the Raspberry Pi 3 Model B’s GPIO pins:

Original source

Once connected, download and install the libraries as per this github project

I’m going to give you slightly modified instructions, which will work with the wiring layout given above.

If you use the latest version of Rasbian Stretch ( I used the 2018-04-18 version), most of the libraries will be installed already.

I use Python 3 as a standard, but the github page has instructions for Python 2 as well.

First, let’s install the necessary Python libraries, if needed:

sudo apt-get update
sudo apt-get install build-essential python3-dev python3-smbus python3-pip python3-imaging python3-numpy

Then install the RPi GPIO library:

sudo pip3 install RPi.GPIO

Once you have installed the Python libraries above, download the Python library from github  and save it to your Raspberry Pi. I saved it to my /home/pi folder for easy or access.

Now run the following command:

sudo python setup.py install

Once installed you can start playing with the example code.  Open the example.py script and change the following values, to match our wiring diagram:

# Raspberry Pi configuration.
RS = 24
RST = 25
SPI_PORT = 0
SPI_DEVICE = 0

Now save the file and execute it by running:

python image.py

Trading Bitcoin, Litecoin and Ethereum

The year is 2017. By now you should have heard of Bitcoin, somewhere or another. I hope.

If not, now is the time to listen! Bitcoin prices are soaring like never before. And if you haven’t invested in, or mined some Bitcoin yet, don’t worry – it’s not too late. The sooner you start investing into Bitcoin in one form or another, the better.

First some basic history of Bitcoin and Litecoin.

Bitcoin started in January 2009, almost 9 years ago.

Bitcoin is a cryptocurrency and use the SHA-265 hashing algorithm.

When I started mining Bitcoin in 2012, using a couple of AMD R 290X graphics cards, 1 Bitcoin (1 BTC) cost about R600. I mined a few bitcoins and sold them over the next few year when prices rose to about R9,000 at the end of 2014 and then finally “crashed” in 2014. My return on investment, on the computer I used to mine Bitcoin and Litecoin was about 170% When

Litecoin started in 2011, as a fork of Bitcoin Core but different to Bitcoin in many ways. It use a different algorithm, scrypt instead of SHA265. My last Litecoin sold for R400 before the

Bitcoin reached an all-time high of USD 17,100 / ZAR 263,800 on the 8th December 2017.

Litecoin is still rising and have reached an all-time high of USD 167.52 /  ZAR 2,900 on the 9th December 2017.

Where to buy, sell and trade Bitcoin or Litecoin? I have been using Ice3X since 2012. You can start with an investment of as little as R250. Buying Bitcoin is as easy as making in EFT of R250, or more, into the specified bank account, and then “bidding” on some Bitcoin fractions on the Ice3X exchange.

From here on you have two options: 

  1. You can sell the Bitcoin, or Bitcoin fractions you brought on the exchange, back on the exchange and make some profit on your sale. If you sell at a higher price than what you paid, you can buy again at a lower price and repeat the process and make some good profit.
  2. OR you can hold onto the Bitcoin that you brought for a few year and sell at a much higher price than what you initially paid. For a long term investment, this could easily earn far greater profits than any “traditional investment” currently on the market. One of the biggest advantage here is that you can sell at any given moment if you need to. Unlike most long term investments which could attract penalties if you pay out early, your Bitcoin or Litecoin investment can be sold whenever necessary.

Lastly, what about security? Ice3X  make use of  Secure Certificates to encrypt all communications on their website and 2 Factor Authentication to ensure that only can login to your account. All transactions need to be verified by you.

How to edit WordPress footer content from Artisteer

If you designed your WordPress theme using Artisteer as template builder, then you might have run into the problem where you can’t easily edit the footer content.

Click here to read how to edit the Artisteer generated Header and Footer content. Or continue reading to understand the context.

I am using Artisteer 4.3.0.60745, but judging from forum posts on the Artisteer forums, this problem has existing on earlier versions.

WordPress themes use something called a Widget to add extra functionality to your website, like a website footer which is the same on all pages. The advantage of this is that you can edit a single WordPress Post, and all pages will get the update immediately. Another advantage is that when you change your WordPress theme, the widget content will remain on your “new website”. Generally people add contact information, and company related links like “Terms of Service” / “FAQ”  / “Delivery Information” / etc to the footer area.

So, why did the developers of Artisteer decide not to use the WordPress Widget functionality? That’s a good question! Instead, they have decided that header, side-bar and footer content be hard-coded into the theme itself. This means that when you change your theme, all those extra content is gone!

How to edit the Artisteer generated Footer or Header content:

  1. Login to your WordPress Admin area.
  2. Click on Themes > Editor. This will open up a text editor
  3. Now edit the following files as needed:
    • sidebar-header.php – Header content, where you normally have your Facebook / Google+ / etc links
    • sidebar-footer.php – Footer content, like your contact details and “Copyright” information
  4. Once edited, and saved, refresh your website and you will see the changes.

 

At this stage I want to suggest that it would be much better to remove all the Artisteer generated content from your footer, and put it into Widgets instead