Devices & Components
Arduino Mega 2560 Rev3
Alphanumeric LCD, 16 x 2
Software & Tools
Arduino IDE
Project description
Code
The code
c_cpp
Just upload it. remove the part of code to print to get a snippet
1#include <LiquidCrystal.h> 2 3// initialize the library by associating any needed LCD interface pin 4// with the arduino pin number it is connected to 5const int rs = A3, en = A5, d4 = A9, d5 = A10, d6 = A11, d7 = A12; 6LiquidCrystal lcd(rs, en, d4, d5, d6, d7); 7 8void setup() { 9 pinMode(A14,OUTPUT); 10 pinMode(A13,OUTPUT); 11 pinMode(A4,OUTPUT); 12 pinMode(A0,OUTPUT); 13 pinMode(A2,OUTPUT); 14 pinMode(A1,OUTPUT); 15 16 digitalWrite(A14,LOW); 17 digitalWrite(A13,HIGH); 18 digitalWrite(A4,LOW); 19 digitalWrite(A0,LOW); 20 digitalWrite(A2,LOW); 21 digitalWrite(A1,HIGH); 22 23 lcd.begin(16, 2); 24 // Print a message to the LCD. 25 lcd.print("Hello, World!"); 26 27} 28 29void loop() { 30 // set the cursor to column 0, line 1 31 // (note: line 1 is the second row, since counting begins with 0): 32 lcd.setCursor(0, 1); 33 // print the number of seconds since reset: 34 lcd.print(millis() / 1000); 35} 36
Downloadable files
Circuit connection.
Wires are just to Indicate. Not needed actually.
Circuit connection.

Circuit connection.
Wires are just to Indicate. Not needed actually.
Circuit connection.

Comments
Only logged in users can leave comments