In this project you are going to connect an LCD to your board and write a short message on it.
The LCD has a parallel interface, meaning that the board has to manage several interface pins at once to control the display.
The first pin is the RS(Register Select) that controls where exactly in the LCD's memory you are writing data to.
There is an Enable pin that enables writing to the registers.
The third one is the R/W(Read/Write) pin that selects from reading or writing mode.
The LCD also has 8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're reading to a register when you read, or the values you are writing when you write.
There are also power supply pins (5V and GND) for powering the LCD, LED Backlight (Bklt- and Bklt+) pins that you can use to turn off and on the LED backlight and a display contrast pin (Vo) to control the display contrast.
What does 16×2 LCD mean? It means that the LCD has 16 columns and 2 rows. You place the LCD on the breadboard and connect it to the board as follows.
The first two pins on the right are used to power up the LCD. The next four pins, the ones with green cables, are the data pins. They allow the LCD to communicate with the board. The next two pins connected by yellow cables are the control pins. There are also three pins used for contrast. Two of them are used to power on the backlight and there is one more pin directly connected to the potentiometer. This way you can control the contrast just by rotating it.
You go to the Wyliodrin Applications page and create a new application. You name it and select Streams as programming language. Once created, you click on the new application's name to open it. Start as usual with the run node. To read the value from the temperature sensor through the analog pin. Next, you need the conversion from 0-1024 values to degrees. It is the same function from the project where you first used the temperature sensor.
Now you have the temperature, what do you do with it? Let's write it on the LCD. How? Use the simple way of Visual Programming Blocks.
Add a visual node and inside it do as follows.
First of all, you need to initialise the LCD. For this you select the Peripherals/LCD/Init LCD block.
To write something, you will use the Perpherals/LCD/Print on LCD [] block. you place it below the Init block and write the message received from the conversion function in it.
Once the project runs, you should see the temperature from your room on the LCD, however, the contrast might be high and the text can be difficult to read. In order to modify the contrast, you just turn the rotary angle.
You run the project.