eeed lcd displays for raspberry pi free sample

In this tutorial we"ll take you through how to connect a 16x2 LCD display up to your Raspberry Pi using GPIO pins. Being able to display a message on the LCD is not only very cool but can be pretty useful too, for example in this tutorial we"ll cover how to get your LCD display to display the IP address of your raspberry Pi.

For this exercise we are going to control the LCD display using 4-bit mode. Whilst is is possible to connect to it in other ways using I2C or the UART this is the most direct method. In order to control the display in this way will we need to use 6 pins on the GPIO port, 4 data pins and 2 control pins.

Register Select – This toggles the Lcd display between two modes, Command mode (high) and Data mode (low). Command mode gives a Instruction to the LCD. Example – “Clear the display” , “Move cursor to home” etc and Data tells the LCD to display characters.

In order for the LCD to work we will wire the circuit up in a fashion similar to the diagram above, but hold off connecting everything together for now! The list below tells you exactly what the pins on the LCD connect to:

Begin assembling the circuit by inserting the Adafruit cobbler into the breadboard. Remember to straddle the cobbler over the centre of the breadboard so that no two pin is in the same row. Next insert the LCD display into the breadboard. Connect the 5V and GND pins from the cobbler to the top of breadboard and also connect Pins 1, 2, 15 on the LCD and 16 to their respective power rails. Your circuit should look similar to the picture below:

Connect the GPIO ribbon cable from the cobbler to the Pi, if everything is working correctly the back light on the LCD should turn on like on the picture above. If it doesn"t work check everything is wired up correctly

Next wire up the potentiometer. The middle pin of the potentiometer is connected to Pin 3 on the LCD display and the other two pins are connected to ground and 5V (it doesn"t matter which way round). Check the potentiometer is working by twisting the nob until you see boxes appear in the first line of the display like in the picture below:

In order to utilize the GPIO pins within Python you will need to Install the GPIO python library. Instructions on how to install the GPIO Python library can be found here.

To get the Python code to run the LCD display we are going to "grab" it from adafruit using GitHub. Make sure your Rasp berry Pi is connected to internet and we"ll use the git command to clone the python code. Run the following commands in the terminal to download the files.

Now we can test the display is working and it is wired up correctly. One of the files we downloaded Adafruit_CharLCD.py contains python class for LCD display control. It also contains a small piece of code so when the program is run it will display a message on the LCD.

If you are using Version 2 of the Raspberry pi you will need to edit the program slightly since pin #21 has now been changed to pin #27. Open the file Adafruit_CharLCD.py with Python or use nano  Adafruit_CharLCD.py command to edit the program within the terminal. Go to line 57 of the code and replace:

Feel free to dive into the code of the program and change what"s displayed on the LCD. To do so open the program to edit like before and scroll to the last line of the code:

Simply change what is  typed in the brackets after lcd.message() to display the text you want.  The command is used to wrap the text onto a new line. A neater way of doing this is to change the last part of the program to look like the following:

This way when you run the program you will be prompted by "type your message here" to enter a message via your keyboard, which will then be displayed on the LCD. This was done by defining a new variable "message" that is equal to the command raw_input(), which allows the user to manually enter text. The part within the brackets of the raw_input() command is simply printed on the computer screen to prompt you what to write.

Getting the LCD display to display some text of your choosing is cool but not that useful. Running the program Adafruit_CharLCD_IPclock_example.py will display the date/time and the IP address of the Pi on the LCD. The program calls upon the methods from the previous program Adafruit_CharLCD.py. Feel free to open the program to look at the coding. To do so open the program in python or use the command sudo nano Adafruit_CharLCD_IPclock_example.pyin the terminal.

eeed lcd displays for raspberry pi free sample

With the included Raspberry Pi Pico C/C++ and MicroPython demos, getting started with this screen is quick and easy. There"s also no soldering required with this LCD display - just slot your Pico into the female headers on the rear and you"re good to go!

This display uses an embedded ST7735S driver, which uses the SPI bus to communicate with your Pico (leaving the majority of your Pico pins free for other things!).

eeed lcd displays for raspberry pi free sample

Seems interesting UGUI. However for example for the controller ST7586S have any examples of LCD functions to associate with UGUI? If you have made and canst send to me …

Vitor AquinoHi Vitor, sure it is possible to connect UGUI to the ST7586S. I will look for some sample code… Best regards AchimHello! I have recently been drawing Lissajous_curve through the Nios II, can I communicate with you?Email:maruixiang96@gmail.com

Thanks for the extensive library. I see you already used a ST7586S in one of your videos demonstrations. I have a similar display but it draws 2 pixel per byte and not 3 pixel as the datasheet . Can you help me with this ? below is the initialization code i used

Hi! Were you able to get 3 pixels per byte?Hi Andrey, yes! In order to use this feature you have to use a “read – modify – write” pset function which reads data from the display, changes it and writes it back to the display. BR Achim

Hi! I have the same problem with the pixels. Could you show me a example about the use of the "Read Modify Write" function to write 3 pixels per byte?. I did not understand this command on the datasheet. When this command is enabled, is it necessary to do the algorithm on the diagram at page 37 of the datasheet every time when i want write data to the display? Or is it only necessary one time on the initialization process?

We need to draw .BMP file while application is running. If you provide your mail id or whatsapp number I can share you more details about my requirements.. We are ready to pay for your services!! WA: +91 9787231007

I find this library somewhat intriging. Do you have any working Arduino examples, and if it is not asking too much – something for a SSD1322 based display?

Can you provide code for the dsPic33 with the SSD1322 driver? That is the exact setup I am trying to run for a project of mine. I am using the Blue Display. Thank you so much!!!!Hi Mike,

AchimAs we"re already talking Microchip, what would be necessary to get a Pic32MZ2048ECH144 and HX8238-A based display to use µGUI?First of all you have to connect the TFT DPI Interface to the PIC. Then initialize the internal DPI Interface of the PIC. After that you only have to write a Pset-function to use uGUI. Hope this helps! By the way: which hardware platform do you use? BR Achim

Have you thought about how to implement screen rotation? I am wondering how to change to portrait from landscape on my display (at compile time, not run time)

I"m also interested in getting a 1.5" OLED SSD1351 running on a Raspberry Pi 2 Model B. In fact, I want to run 3 displays from that Pi (without exhausting the GPIO either–it"ll be running 3 sensors too).

At first i would like to congratulate you for this great library/project. I tested it in the STM32F429 Discovery and liked a lot. So, I would ask if you are interested in creating an adaptation layer for an event manager based on RTOS services. I beleive that through RTOS semaphores, queues and timers it is possible to better manage the CPU resources. I started myself a GUI event handler, as you can see here:

However, i´m not a great GUI designer. I just have a RTOS project and i would like to disseminate the use of such a great tool for embedded software development. Even, i developed a demo based in your code using RTOS services. Doing that i realized a excessive CPU usage for the touch screen reading (like 10%). I just raised the I2C clock to 250khz, droping the CPU usage for less than 1%.

First, I want to thank you for this library. I"ve used 0.2 version successfully with an OLED with SSD1322 controller on PIC32. Are the window and button functions work on OLED? I haven"t had success with the example code.Hi Andre,

Starting with your example of uGFX 3.0 on Stm32f429-Discovery (embd LCD removed) i have changed only screen dimensions to the ltdc.h in order to make it all work and so on it"s a really good result.

Hi there i am after a oled display for a pure evoke flow radio and have been told it is a pmo 19301 and is 2.7" diagonaly my question is do you know where i can buy one of these units.

I was wondering if I can use this library to get SSD1322 work with xmegaA3AU ? Can you help with some sample code, that would be great! Looking forward to your reply.

Nice work! So impressive!I am new to OLED and now working a project using a NHD-3.12-25664UCB2 OLED with PIC, can u give me an pic code example with the SSD1322 driver? Thanks a lot in advance!Hi, have a look at the forum. There is an example Pset function for the SSD1322.

i really wonder about your gui. it is very simple to use. i want to draw a image on my lcd. i also done by using your library with given example image. now i want to convert image to header file. can you suggest any software to do that.Hi Arun, I think there is a conversion utility on the ST microelectronics page. I can’t remember the name, but I’m sure there is one. BR Achim

I tried, but I can not force to work my 240×128 display with T6963C controller . Could you please send me the code to this: 240×128 LCD | Driver: T6963C | Interface: 8080

Is there a sample project for STM32f7xx-Discovery also available?Hi, yes I’m going to write an example for the STM32F7. Unfortunately I’m very busy right now, so please be patient…

well, this is my first time using STM. i"m using stm32f407 by the way. i really want to use ugui with my stm and ssd1289. do you have any project example that i can use as refrence? it would be really helpful. thanks!Please have a look at the forum. Have you already downloaded my example projects? BR Achim

RegardsHi Ahmed, currently I don’t have any example for Codevision. Please have a look at my example projects. It should be quite easy to port them to your platform. BR Achim

Super nice library. It"s very well coded and easy to use. I"ve began developing on it a couple of days ago and will probably go with your library for the rest of my project.

thank you very much for the feedback! Good idea! There will be some more new acceleration functions available in 0.4…Please post your project at the forum!

I"ve set it up on an STM32L100RCT6 with an 128×64 glcd, and everything works like a charm, except the UG_DrawLine() function, which seems to always draw a falling line, no matter how the arguments are arranged