Modified Firmware

Store Forums Defusable Clock General Discussion Modified Firmware

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #582
    philmonty
    Member

    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!

    #1132
    Michael
    Keymaster

    Awesome, Phil. Thanks. I added your images to the gallery:

    http://nootropicdesign.com/defusableclock/gallery.html

    #958
    philmonty
    Member

    I 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
    }
    }

    #959
    philmonty
    Member

    without 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
    }
    }

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.