How To Controlling LCD With Arduino

Required Hardware

For users who do not have Hackerspace Karachi Arduino KiT v1.0

  • Arduino Board
  • Breadboard
  • I2C LCD
  • Hook-up Wires

Circuit

For users who do not have Hackerspace Karachi Arduino KiT v1.

Schematic

Code

                    

1. /*
2. LCD display with Arduino
3.
4. This example shows how to use LCD with Arduino.
5.
6. The circuit:
7. – LCD
8. SDA connected to analog pin A4.
9. SCL connected to analog pin A5.
10.
11. http://hackerspacekarachi.org/
12. */
13. //Library version:1.1
14. #include
15. #include 16.
17. LiquidCrystal_I2C lcd(0x27, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2
line display
18.
19. void setup()
20. {
21. lcd.init(); // initialize the lcd
22. lcd.init();
23. // Print a message to the LCD.
24. lcd.backlight();
25. lcd.setCursor(3, 0);
26. lcd.print(“Hello, world!”);
27. lcd.setCursor(0, 1);
28. lcd.print(“Robot Arduino!”);
29.
30. }
31.
32.
33. void loop()
34. {
35. //n

1. /*