DISPLAYING INFORMATION WITH LCD SCREENS


The LCD screen used in the Pilot RC is a 16x2 LCD module. This means that the module has 16 columns and 2 rows for a total of 32 characters that can be displayed at one time.

Thankfully, the Pilot RC has an LCD Screen Header that you just plug your LCD Screen Module into to. Then, there is a potentiometer on the bottom left of the board that you can change with a Phillips head screwdriver. Adjust it until you can clearly see the characters show up on your screen.

This code uses the the built in Arudino LCD library to communicate with the Screen, and you can download our LCD Basic example code in our downloads section.

The code starts out using the included LiquidCrystal Library that is already installed when you downloaded the Arduino IDE. Next, we want to assign which pins of the Arduino are connected to the pins of the LCD display. For the Pilot RC, they are displayed below.

#include <LiquidCrystal.h>

const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 6;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

After we declare and include the libraries that we need, we move on to initializing the LCD display in the setup. This has to be done so that the Arudino knows how big the LCD screen is. The display we are using in a standard 16 columns and 2 row LCD.

To write characters to the LCD screen, all we have to do is use the lcd.print() function. Just type whatever characters that you would liked to be displayed here, just make sure that the total length of the print is not longer than 16 characters!

void setup() {
  lcd.begin(16, 2);
  lcd.print("Hello, World!");
}

In this LCD_Basic sketch, we want to display on the bottom row how much time in seconds has passed since the program started. how much time has passed on the bottom row. To change where we want the next print function to be, we use the lcd.setCursor() function. Remember that the first row on the LCD screen is row 0, while the next row is row 1.

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
}

That is all the code that you need to start writing basic messages on your Pilot RC! Change some of the code around to display whatever you want!