aboutsummaryrefslogtreecommitdiff
path: root/arduino_sketch
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <elena.valhalla@gmail.com>2011-12-23 23:05:50 +0100
committerElena ``of Valhalla'' Grandi <elena.valhalla@gmail.com>2011-12-23 23:05:50 +0100
commit2b99bf003646de82a44be8ac2469e0bf4c67442e (patch)
tree11bcef6b7f7c1c0d4b1eeb476ccabb9ace52371c /arduino_sketch
parent1c7a72785b5a011c9bc1c749438069b73835a214 (diff)
arduino sketch: added LED test mode
Diffstat (limited to 'arduino_sketch')
-rw-r--r--arduino_sketch/fuzzy_alarm_clock_ds1307/fuzzy_alarm_clock_ds1307.pde23
1 files changed, 20 insertions, 3 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 3e3188a..a4e0040 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
@@ -61,9 +61,9 @@ void setup () {
TCCR2A = _BV(COM2A0) | _BV(COM2B1) | _BV(WGM20);
TCCR2B = _BV(WGM22) | _BV(CS22);
- digitalWrite(RPIN,255);
- digitalWrite(YPIN,255);
- digitalWrite(BPIN,0);
+ digitalWrite(RPIN,HIGH);
+ digitalWrite(YPIN,LOW);
+ digitalWrite(BPIN,LOW);
// if the RTC is already running read alarms and status,
// otherwise set everything to a sane default
@@ -157,6 +157,9 @@ void check_serial() {
case 'd':
s_toggle_debug();
break;
+ case 'l':
+ s_led_test();
+ break;
case 'h':
s_print_help();
break;
@@ -267,6 +270,19 @@ void s_toggle_debug() {
}
}
+void s_led_test() {
+ if ( a < 0 ) {
+ Serial.println("Testing LEDs");
+ digitalWrite(RPIN,HIGH);
+ digitalWrite(YPIN,HIGH);
+ digitalWrite(BPIN,HIGH);
+ delay(1000);
+ digitalWrite(RPIN,HIGH);
+ digitalWrite(YPIN,LOW);
+ digitalWrite(BPIN,LOW);
+ }
+}
+
void s_print_help() {
Serial.println("");
Serial.println(" a<s> - set an alarm");
@@ -281,6 +297,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(" l - test LEDs");
Serial.println(" h - print this help");
}