Store › Forums › Defusable Clock › General Discussion › Modified Firmware
- This topic has 3 replies, 2 voices, and was last updated 12 years, 10 months ago by Michael.
-
AuthorPosts
-
January 9, 2012 at 1:54 am #582philmontyMember
Hi everyone
Attached is a picture of my defusable alarm clock – we went with a pipe look and feel, and the pipe doubles as a hidden store for valuables. You can buy the pipe and end caps at any hardware store (about $20) – I cleaned mine up with some steel wool and brasso polish – it looks very cool (and dangerous). I also put “inert” labels on the back, and deliberately didn’t link any wires into the casing so as to avoid possible problems.
Also, I modified the firmware to add a “chime” function. Between 8am and 10pm, it “beeps” and counts down to the next hour (i.e. number of beeps matches the hour), and then detonates. Makes it nice and easy to appreciate the clock capabilities – sort of like a modern “Big Ben”.
I inserted this into the code (near the end):
seconds++; //find this near the end and add the below code afterwards:
//Added this block to count down for 30 seconds to each hour
if (((hours >= 8) && !pm) || ((hours <= 10) && pm)) { // only chime between 8am and 10pm
if ((minutes ==59) && (seconds == (60 - (hours + 1)))) { //countdown top of hour for number of seconds the hour is turning
displayCountdown = true;
countdownSeconds = (hours + 1);
countdownRunning = true;
}
}
Michael may suggest code improvements – I am a hacker at best.
Enjoy!
January 9, 2012 at 2:43 am #1132MichaelKeymasterAwesome, Phil. Thanks. I added your images to the gallery:
January 10, 2012 at 9:57 pm #958philmontyMemberI made a mistake in the modified firmware – if you use the firmware that writes to EEPROM my changes result in the countdown time being written – this corrects that. I also added the ability to flash the colon (typical in digital clocks).
// Flash the Colon
if (digitalRead(COLON) == LOW)
digitalWrite(COLON, HIGH);else
digitalWrite(COLON, LOW);//Added this block to chime & count down to each hour
if (((hours >= 8) && !pm) || ((hours <= 10) && pm)) { // only chime between 8am and 10pm if ((minutes ==59) && (seconds == (60 – (hours + 1)))) { //countdown top of hour for number of seconds the hour is turning displayCountdown = true;
countdownSeconds = (hours + 1);
countdownRunning = true;
ticked = false; //Need to do this to prevent writing in the EEPROM value for Countdown seconds
}
}January 10, 2012 at 9:57 pm #959philmontyMemberwithout the smiles inserted.
// Flash the Colon
if (digitalRead(COLON) == LOW)
digitalWrite(COLON, HIGH);else
digitalWrite(COLON, LOW);//Added this block to chime & count down to each hour
if (((hours >= 8) && !pm) || ((hours <= 10) && pm)) { // only chime between 8am and 10pm if ((minutes ==59) && (seconds == (60 – (hours + 1)))) { //countdown top of hour for number of seconds the hour is turning displayCountdown = true;
countdownSeconds = (hours + 1);
countdownRunning = true;
ticked = false; //Need to do this to prevent writing in the EEPROM value for Countdown seconds
}
} -
AuthorPosts
- You must be logged in to reply to this topic.