]> git.piffa.net Git - arduino/blob - books/pdummies/APFD_Chapter7_ArduinoClock_LCDTester/APFD_Chapter7_ArduinoClock_LCDTester.ino
first commit
[arduino] / books / pdummies / APFD_Chapter7_ArduinoClock_LCDTester / APFD_Chapter7_ArduinoClock_LCDTester.ino
1 /* Arduino Projects for Dummies
2  * by Brock Craft 
3  *
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
7  *
8  * This code just tests the LCD display
9  *
10  * Uses the default Wire and LiquitCrystal libraries
11  * and the Adafruit RTC library
12  *
13  * v0.1 30.04.2013
14  * Adapted from http://www.adafruit.com/products/746
15 */
16
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 
20
21 RTC_DS1307 rtc;                         // Create a realtime clock called rtc
22 LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  // Create an LCD called lcd 
23
24 void setup () {
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
31 }
32
33 void loop(){
34 }