Coding for wires

Store Forums Defusable Clock General Discussion Coding for wires

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #432
    CKS
    Member

    So i have bought the clock, and while i’m waiting for it to get here i thought i would ask some questions, but they might be a little dumb, mostly because this is all very new to me

    1. Is it possible to connect this with outside broads?

    2. what code would I change to make the wires not random

    3. is it possible to make it so you have to cut the wires in a specific order or it will go off i.e. green, red ,blue ,and yellow.

    Cheers CKS

    #1082
    Michael
    Keymaster

    Not sure I understand what you mean by connecting to outside boards. What do you want to do?

    Study the source code available on the Hack page: http://nootropicdesign.com/defusableclock/hack.html
    The code for assigning the wires is in the function [tt:1lildtnm]countdown()[/tt:1lildtnm]. Just change this code if you want it nonrandom.

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

    To require a particular sequence, you’d have to be more clever, but the work is in the function [tt:1lildtnm]countdown()[/tt:1lildtnm]. With some coding skill, you can do it.

    #1085
    CKS
    Member

    did some research and what i mean to say is there control pins that i can connect to, to driver some servos or motors, or is there a way to connect more pins to the broad?

    #1080
    Michael
    Keymaster

    No, but you can use one of the LED connections if you want. That’s one way to connect to something external.

    I didn’t want to make it too easy to control external devices in case someone wanted to make something actually dangerous.

    #1524
    greenbean
    Member

    ok so I have a noob question about this . what words in the coding do I change or remove, and to what, in order to make it not random. this is my first time trying to change code, so please be kind.

    #1526
    Michael
    Keymaster

    Just change the code in the countdown() function to assign the defuse pin and det pin to fixed values.

    defusePin = WIRE_1;
    detPin = WIRE_3;

    Remove the random assignment:


    defusePin = random(WIRE_1, (WIRE_4+1));
    detPin = defusePin;
    while (detPin == defusePin) {
    detPin = random(WIRE_1, (WIRE_4+1));
    }
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.