-
Notifications
You must be signed in to change notification settings - Fork 1
/
HelloWorld_I2C.ino
61 lines (51 loc) · 1.75 KB
/
HelloWorld_I2C.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// OVERVIEW //////////////////////////////////////
// LiquidCrystal NKC: Library for Arduino
// "Hello, World!" Arduino IDE Demo Sketch
// Sketch v21.316 by Dominic M. Luciano
//
// This sketch is intended to highlight & display
// the major functions of the LiquidCrystal NKC
// library and their potential uses and usages in
// conjunction with an NKC Electronics Serial LCD
// display module running in RS232 mode
//////////////////////////////////////////////////
// CONNECTIONS ///////////////////////////////////
// LCD PIN 2 [VSS] -> ARDUINO UNO GND
// LCD PIN 3 [VDD] -> ARDUINO UNO +5V
// LCD PIN 7 [SCL] -> ARDUINO UNO PIN A5 [SCL]
// LCD PIN 8 [SDA] -> ARDUINO UNO PIN A4 [SDA]
//////////////////////////////////////////////////
#include <Wire.h>
#include <LiquidCrystal_NKC.h>
// DECLARATIONS //////////////////////////////////
// Constructor & Parameters //
// Interface, Baud Rate, Columns, Rowa
LC_NKC lcd(I2C, 0x28, 20, 4);
void setup() {
// Initialize LCD Module
lcd.begin();
// Turn On LCD Backlight
lcd.backlight();
// Or Use: lcd.setBacklight(HIGH);
// Set Cursor to "Col 0, Row 0" (1st Col, 1st Row)
lcd.home(); // Or Use: lcd.setCursor(0, 0);
// Clear The Entire LCD
lcd.clear();
// Print Some Text to the LCD
lcd.print("HELLO, WORLD!");
// Set Cursor to "Col 0, Row 1" (1st Col, 2nd Row)
lcd.setCursor(0, 1);
// Print Some Text to the LCD
lcd.print("LiquidCrystal NKC");
// Set Cursor to "Col 0, Row 2" (1st Col, 3rd Row)
lcd.setCursor(0, 2);
// Print Some Text to the LCD
lcd.print("By Dominic Luciano");
// Set Cursor to "Col 0, Row 3" (1st Col, 4th Row)
lcd.setCursor(0, 3);
// Print Some Text to the LCD
lcd.print("github.com/DomiLuci");
}
void loop() {
// Program's Main Loop Code Goes Here //
}