aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arduino_sketch/fuzzy_alarm_clock_ds1307/fuzzy_alarm_clock_ds1307.pde30
1 files changed, 30 insertions, 0 deletions
diff --git a/arduino_sketch/fuzzy_alarm_clock_ds1307/fuzzy_alarm_clock_ds1307.pde b/arduino_sketch/fuzzy_alarm_clock_ds1307/fuzzy_alarm_clock_ds1307.pde
index b9b9c1f..2f979e4 100644
--- a/arduino_sketch/fuzzy_alarm_clock_ds1307/fuzzy_alarm_clock_ds1307.pde
+++ b/arduino_sketch/fuzzy_alarm_clock_ds1307/fuzzy_alarm_clock_ds1307.pde
@@ -190,6 +190,9 @@ void check_serial() {
case 'd':
s_toggle_debug();
break;
+ case 'D':
+ s_dump_rtc();
+ break;
case 'l':
s_led_test();
break;
@@ -308,6 +311,32 @@ void s_toggle_debug() {
}
}
+void s_dump_rtc() {
+ Serial.print("| 0x00 | ");
+ Serial.print(RTC.readData(0x00),BIN);
+ Serial.println(" | |");
+ Serial.print("| 0x08 | ");
+ Serial.print(RTC.readData(0x08),BIN);
+ Serial.println(" | st |");
+ Serial.print("| 0x09 | ");
+ Serial.print(RTC.readData(0x09),BIN);
+ Serial.println(" | a |");
+ Serial.print("| 0x0a | ");
+ Serial.print(RTC.readData(0x0a),BIN);
+ Serial.println(" | cmin |");
+ for (int i = 0; i < NALARMS + 3 ; i ++ ) {
+ for ( int j=0; j < 5 ; j ++ ) {
+ Serial.print("| 0x");
+ Serial.print(i,HEX);
+ Serial.print(" | ");
+ Serial.print(RTC.readData(0x0b + i*5 + j),BIN);
+ Serial.print(" | Alarm ");
+ Serial.print(i,DEC);
+ Serial.println(" |");
+ }
+ }
+}
+
void s_led_test() {
if ( a < 0 ) {
Serial.println("Testing LEDs");
@@ -345,6 +374,7 @@ void s_print_help() {
Serial.println(" p - print the alarms");
Serial.println(" t - print the clock");
Serial.println(" d - toggle printing of debug informations");
+ Serial.println(" D - dump RTC registers (interesting) data");
Serial.println(" r - reset status and alarms");
Serial.println(" l - test LEDs");
Serial.println(" h - print this help");