/************************************************************************************************** * * Real Time Clock * * Version: 1.0.0 - January 2009 * Author: Etienne Ribeiro / tutorial assistant caad / eribeiro[at]ethz.ch * (based on Code from Maurice Ribble) * Supervisor: Christoph Wartmann / chair for caad - ETH Zürich / wartmann[at].arch.ethz.ch * * Desc: This Module can be used to plug a Real Time Clock to your project. Connect the * clock to your I2C-Pins (SCL, SDA). * ***************************************************************************************************/ // // Setup void setup() { // LED (2 * blink) pinMode(48, OUTPUT); digitalWrite(48, HIGH); delay(200); digitalWrite(48, LOW); delay(200); digitalWrite(48, HIGH); // Initialize Timer iniWire (); Serial.begin(9600); // Set Clock time (only neede to ajust the clock) /* byte second, minute, hour, dayOfWeek, dayOfMonth, month, year; second = 45; minute = 3; hour = 7; dayOfWeek = 5; dayOfMonth = 17; month = 4; year = 8; setDate (second, minute, hour, dayOfWeek, dayOfMonth, month, year); */ } // // Loop void loop() { // Read Data from Clock byte second, minute, hour, dayOfWeek, dayOfMonth, month, year; getDate(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year); // Have a break delay(1000); }