Now, let's bring up the Arduino IDE. Before you start coding, you'll need to get the library associated with your display and install it in the IDE.
For this display, the library is found at http://www.seeedstudio.com/wiki/Grove_-_Serial_LCD. If you go to this website and select the library, it will take you to another web page that will allow you to download a .zip
file with the library.
Here are the steps:
.zip
file should then exist in your Downloads directory. Now, you'll need to place these files in the libraries directory of your Arduino installation. The following screenshot shows the directory structure of the most common installation of the Arduino IDE:.zip
file that holds your library. When it asks for the directory to unzip to, select this directory. When complete, this library should be added as a subdirectory in your libraries directory, as shown in the following screenshot:.zip
file. Once the library is installed, go back to the main IDE screen and you should be able to select one of the examples from the SerialLCD library, for example, the HelloWorld example, as seen in the following screenshot:Note that the slcd.print("hello, world!");
statement is the way to send a string text to the serially connected LCD. The slcd.setCursor(0, 1);
command sets the cursor to the start of the second line of the display. The slcd.print(millis()/1000);
statement is an example of how to print a number to the display, in this case, the number of seconds.
Now, you can add all sorts of text by simply editing the slcd.print("hello, world!");
line in the setup()
function or adding this same function to the loop()
function. Make sure that if you place a message in the loop, use the delay(2000)
function after it to give the user some time to read the display before you change it.
13.59.76.150