Week 11: Arduino Libraries and Arduino Displays
Continuing on the exploration of Arduinos and how to use them, we expanded our range of possible functions and commands we can use with the Arduino Uno by installing libraries and learned how to use specifically the LiquidCrystal library to make text display on an LCD screen.
We started off by downloading a .ZIP file from student central, which is the format of libraries which are compatible with the Arduino Software from what I understand. I then had to find my Arduino Folder on my laptop which is where I would put the .ZIP Liquid Crystal file once it’s downloaded. Finding the right folder was not difficult whatsoever, I just have to go to my Finder> Documents> Arduino and place the file in that folder. Once the Liquid Crystal file was placed in the right place, I had to open the Arduino Software, and go to Sketch> Include Library> Add .ZIP Library… and select the .ZIP file I just placed in the Arduino file. The Arduino file should look similar to what it looks like in the image below.
Once I completed this, the Liquid Crystal Library was installed to my Arduino Software, and I could start to work with the LCD display. I needed to use the format which was given on student central so that I didn’t spend the entire tutorial copying commands. To make it so that I could easily find the right folder including the .ino file, I put it into a folder called LCD display as shown in the image below.
sss I then hooked up my LCD display according to the instructions which were given by the lecturer, following the instructions step-by-step. The specific instructions can be found below.
sss After properly hooking up the LCD display, it lit up, and looked like:
And one las important step, as to use the tuning tool to twist the blue screw looking piece on the back of the LCD display. I had to tune it until the boxes were gone.
Once everything looked as if it were working, I moved on to the code, and just had a trial run to see if the code would properly send to the Arduino from the software and send the vanilla text that came with the code. And the outcome can be seen here.
Seeing the code from from the example given to us, it was easy to get the hang of what each value meant, and how to structure the code. The main piece of new code is “lcd.setCursor(0,0)” where in the brackets, the first number is how many characters into the line the text should start, while the second number is representative of which row the text is for, where 0 is the first row, and 3 is the fourth row. Each line could hold up to 20 characters before going off-screen. And to clear the screen, the command is “lcd.clear()”.
I then edited the code to make the screen show the opening dialogue of a movie that is held very dear to me, the Bee movie. After some research and, counting the characters to know how many words I can fit into each line, I came up with the outcome below, with a file attachment of the file further below the video.