]> git.piffa.net Git - sketchbook_andrea/blob - advanced_projects/LCD_clock/LCD_working_0/LCD_working_0.ino
Initial Commit
[sketchbook_andrea] / advanced_projects / LCD_clock / LCD_working_0 / LCD_working_0.ino
1 // Chapter 7: Arduino Alarm Clock 
2 // An alarm clock that uses the Adafruit Industries DS1307 RTC Breakout board 
3 // and a 16 x 2 Parallel LCD Display 
4 #include <Wire.h> // I2C Wire Library for communicating with the DS1307 RTC 
5 #include "RTClib.h" // Date and time functions for the DS1307 RTC connected 
6 #include <LiquidCrystal.h> // Display functions for the LCD Display 
7 RTC_DS1307 rtc; // Create a realtime clock called rtc 
8 LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Create an LCD called lcd 
9
10
11 void setup () { 
12   Wire.begin(); // Enables the communication for the LCD 
13   rtc.begin(); // Enables the RTC 
14   lcd.begin(16, 2); // Enables the LCD 
15   
16   lcd.print(" It's Alive!"); // Print a message, centered, to the LCD to confirm it's working 
17   delay(500); // Wait a moment so we can read it 
18   lcd.clear(); // Clear the LCD 
19
20 void loop(){ 
21   
22
23