From ad91932ec1eafc7f88604dba85d5327e82205c81 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Thu, 26 Jan 2012 07:09:47 +0100 Subject: arduino sketch: fixes to the debug functions --- .../fuzzy_alarm_clock_ds1307/fuzzy_alarm_clock_ds1307.pde | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'arduino_sketch') 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 1b5fd89..ae5b4c9 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 @@ -45,7 +45,7 @@ int st = 0; // alarm status (minutes from alarm - TIN) char alarms[NALARMS][5]; // alarm settings char cmin; // current minute signed char a = -1; // current alarm -char dbg = 0; // print debug informations +bool dbg = false; // print debug informations bool ringing = false; // sound the alarm bool pressed = false; // stop button status @@ -285,9 +285,9 @@ void s_print_time() { void s_toggle_debug() { if ( dbg ) { - dbg = 0; + dbg = false; } else { - dbg = 1; + dbg = true; } } @@ -313,6 +313,9 @@ void s_reset_alarms() { st = 0; a = -1; save_status(); + analogWrite(RPIN,128); + digitalWrite(YPIN,LOW); + digitalWrite(BPIN,LOW); } void s_print_help() { @@ -329,6 +332,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(" r - reset status and alarms"); Serial.println(" l - test LEDs"); Serial.println(" h - print this help"); } -- cgit v1.2.3