Author Options:

Secret Knock Detecting Coding Confuse Answered

Can somebody explain to me about line:int secretKnock [maximumKnocks] = {50,25,25,50,100,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}this is the initial setup:Shave and a Hair Cut..Is it mean that I can only knock using this type of knock?Then how do I record new knock...Else,is it really matter if I use any type of program button? I mean NO, NC?It because my reset button went crazy each time I try to record other knock, it only listen to Shave and a Haircut knock...all the master please help me...?



The forums are retiring in 2021 and are now closed for new topics and comments.

9 years ago

If its "Secret Knock Detecting Doorlock"...

then its 1 SPST momentary pushbutton. (normally "off")

"about Line 39: int secretCode[maximumKnocks] = {50, 25, 25, 50, 100, 5.....

This is the default knock that it recognizes when you turn it on. This is weird rhythmic notation since every value is a percentage of the longest knock. If you're having a hard time getting it to recognize "shave and a hair cut" change this to {100,100,100,0,0,0... and a simple sequence of 3 knocks will open it."

So, you preprogram the knock you want...or
hold the programming button, then knock what you want, then release the button.

If the arduino craps the bed while you hit the button, something is wired wrong and/or shorting out the power supply.