Programation Defusable Clock V2

Store Forums Defusable Clock General Discussion Programation Defusable Clock V2

This topic contains 5 replies, has 3 voices, and was last updated by  Sander 4 years ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #753

    Kogoro Mouri
    Member

    Hello,

    I have buy the defusable clock, first thing, it’s just great, will used for my friend webserie, on airsoft, and many other thing 🙂

    I have buy the USB connection for programing the clock.

    I have tranfered the downloaded firmware into the clock, but after this, i am unable to set the countdown by pressing the red button (I can go backward but cannot go upward. Ie: 40:00 -> 20:00 OK / 20:00 -> 40:00 by clicking hour or minuts make nothing) I dont know what changed but now minuts and seconds UP isnt working.

    I have also tried to modify the Alarme-Countdown function, When i set alarm countdown mode, when the our is set, hen reach the our, its beep 2-3 seconds and after it start countdown, i will set the “Beeping time” before starting more long time beeping.

    I have tried modify this:


    if (alarmMode == ALARM_DET) {
    for(int i=0;i<4;i++) {
    beep(3900, 250, false);
    delay(250);

    But its modify the sound with time (make slow and long beep and not default fast beep for many seconds)
    It is possible to make help for this?

    I will also set the Detonate Wire (WIRE_4) (i have located where set this modification but i dont wkow what i need to input as “Random”)

    // assign random pins
    defusePin = random(WIRE_1, (WIRE_4+1));
    detPin = defusePin;
    while (detPin == defusePin) {
    detPin = random(WIRE_1, (WIRE_4+1));
    }

    I will also make accelerate/ stop-start coundown when cut certain wires.

    I will also for project to make the bomb starting countdown with a mobile phone (by connection rumble wire to powering a small switch, that wil connect + and – of the red button. i think if this is working, by sending an sms that will make the Clock starting countown ^^

    Ah, in fact, is it possible to make starting the countdown with the programing port by sending signal or other things?

    I also

    PS: Sorry for my language, i speak french.

    Cordially.

    #2236

    Kogoro Mouri
    Member

    Hello, Some news, the problems with configuration of the countdown time is resolved by the new Firmware ,

    I have also found for make more long the “Beeps” of alarm stargting countdown and alarm for detonation:

    (normaly, the line is: “for(int i=0;i<8;i++) {" I have chanto 8 to 60 for the detonation alarm)

    void detonate() {
    for(int i=0;i<60;i++) {
    digitalWrite(LED_DET, HIGH);
    beep(5000, 50, false);
    delay(25);
    digitalWrite(LED_DET, LOW);
    delay(25);
    }

    This is for the Programable timer countdown starting:

    (I have change to 16 and 250 to 150 )


    }
    if (alarmMode == ALARM_DET) {
    for(int i=0;i<16;i++) {
    beep(3900, 150, false);
    delay(250);

    I have also found on the forum how to set the detonate wire :


    detPin = WIRE_1; // or whatever you choose
    defusePin = detPin;
    // now find a random value for defusePin that is not detPin.
    while (defusePin == detPin) {
    defusePin = random(WIRE_1, (WIRE_4+1));
    }

    Now i serach how to make (for Ex: wire 3 acellerate the timer, and Wire 4 stop the timer for 1-2 seconds and after restart the countdown) every one can help for programming this?

    #2321

    ericmelvin10
    Member

    I’ve re-programmed to defuse it cutting the wires in sequence.

    #2324

    Sander
    Participant

    Hey ericmelvin,
    I would like to try the sequence cutting also.
    Could you post the code for that? That would be awesome.
    Regards
    Sander

    #2335

    ericmelvin10
    Member

    In the function countdown:

    I set the pins to wires (one for automatic detonation[Wire_1] and 3 for defusing sequence[Wire_2–>Wire_4–>Wire_3])

      defusePin = WIRE_2;
    defusePin2 = WIRE_4;
    defusePin3 = WIRE_3;
    detPin = WIRE_1;
    DetState = 0;

    Then in the main loop of the function:

    while ((countdownSeconds > 0) && (!defused))  {
    for(int i=0;i<10000;i++) {

    if (digitalRead(detPin) == HIGH) {
    countdownSeconds = 0;
    break;
    }
    // old stuff commented ;-)
    /*if (digitalRead(defusePin) == HIGH) {
    defused = true;
    break;
    }*/

    //enters the sequence:

    if ((digitalRead(defusePin) == HIGH) && (DetState == 0))
    {
    DetState++;
    beep(4200, 30); //just a noise for comfirmation :)

    }
    if ((digitalRead(defusePin2) == HIGH) && (DetState < 1))
    {
    countdownSeconds = 0;
    }
    else if ((digitalRead(defusePin2) == HIGH) && (DetState == 1))
    {
    DetState++;
    beep(4200, 30);
    }
    if ((digitalRead(defusePin3) == HIGH) && (DetState < 2))
    {
    countdownSeconds = 0;
    }
    else if ((digitalRead(defusePin3) == HIGH) && (DetState == 2))
    {
    defused = true;
    }
    }

    As you can see, it’s pretty simple , but works like a charm 🙂

    #2336

    Sander
    Participant

    Awesome man!!! Thnx very much.
    Im gonna try it.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.