Store › Forums › Defusable Clock › General Discussion › Coding for wires
- This topic has 5 replies, 3 voices, and was last updated 13 years ago by
Michael.
-
AuthorPosts
-
May 31, 2012 at 1:29 am #432
CKS
MemberSo 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
June 1, 2012 at 12:31 pm #1082Michael
KeymasterNot 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.
June 1, 2012 at 4:07 pm #1085CKS
Memberdid 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?
June 1, 2012 at 5:07 pm #1080Michael
KeymasterNo, 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.
December 6, 2012 at 8:12 pm #1524greenbean
Memberok 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.
December 7, 2012 at 1:54 pm #1526Michael
KeymasterJust 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));
}
-
AuthorPosts
- You must be logged in to reply to this topic.