Download presentation
Presentation is loading. Please wait.
1
LCD
2
Purpose LCD screens can be used by an Arduino to display numbers and text
3
Wiring The screens communicate over a specific protocol called I2C
It uses two communications pins, SDA and SCL On UNO boards, the A4 and A5 pins perform this task
4
Wiring
5
Wiring A4 and A5 SDA and SCL CIJE boards contain both:
Either can be used
6
Libraries LCD’s contain 1,000’s of tiny independently controlled pixels Coding these independently would be impossible Instead we use a library Libraries can contain vast amounts of sub-coding, easily accessible using simple keywords For example: Tell Arduino to print the letter “A”, and the library inserts the coding necessary to control those pixels
7
Libraries The LCD library can be downloaded at theCIJE.org/Arduino
8
Libraries The downloaded file, in the form of a zip file, must be installed
9
Coding Within the void loop(), some commands you can use are:
lcd.backlight(); // will turn on the blue backlight lcd.noBacklight(); // will turn off the blue backlight lcd.clear(); // will clear the screen lcd.setCursor(0,0); // move the cursor to cord. (x,y) lcd.print("Hello"); // prints "Hello" lcd.print(x); // prints the value of x
10
Coding Example If you had an integer "x" and it was equal to 96:
lcd.clear(); lcd.setCursor(0,0); lcd.print("Hello, ARDUINO"); lcd.setCursor(0,1); lcd.print(x); Would display:
11
LAB Complete the LCD lab
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.