Go Down

Topic: Help with understanding this code.  (Read 346 times) previous topic - next topic

PaulS

Well, that is a lot better, at least optically.
But you still have to do this for your modified code :

explain how the variable button  is going to get its value.
Doesn't
Code: [Select]
button = analogRead(buttonPin);
explain it well enough?
The art of getting good answers lies in asking good questions.

Ellis_Leahy

Okay thank you!
Doesn't
Code: [Select]
button = analogRead(buttonPin);
explain it well enough?
So you are suggesting for me to used that? and where would i put this in my code? just at the end of my code or at the start? and then write the decision making aka the if statements?

PaulS

Quote
So you are suggesting for me to used that?
I copied that line from your code.
The art of getting good answers lies in asking good questions.

6v6gt

Oops. I missed that.
Anyway, the OP can now give an example of the "tune" which has to be played to open the lock. Of course, with only 2 piano keys available it's unlikely to be a Rachmaninoff piece, but useful to know would be the number of notes required to open the lock.

Go Up