1 /* Arduino Projects for Dummies
4 * Chapter 7: Building an Arduino Clock
5 * An alarm clock that uses the Adafruit Industries DS1307 RTC Breakout board
6 * and a 16x2 Parallel LCD Display
8 * This code just tests the LCD display
10 * Uses the default Wire and LiquitCrystal libraries
11 * and the Adafruit RTC library
14 * Adapted from http://www.adafruit.com/products/746
17 #include <Wire.h> // I2C Wire Library for communicating with the DS1307 RTC
18 #include "RTClib.h" // Date and time functions for the DS1307 RTC connected
19 #include <LiquidCrystal.h> // Display functions for the LCD Display
21 RTC_DS1307 rtc; // Create a realtime clock called rtc
22 LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Create an LCD called lcd
25 Wire.begin(); // Enables the communication for the LCD
26 rtc.begin(); // Enables the RTC
27 lcd.begin(16, 2); // Enables the LCD
28 lcd.print(" It's Alive!"); // Print a message, centered, to the LCD to confirm is working
29 delay(1000); // Wait a moment so we can read it
30 lcd.clear(); // Clear the LCD