Hello. So i wanted to try the passwork with keypad example and i added something new to the code but it doesnt seem to work. (the rest of the code is the same with the example )
void checkPassword(){
if (password.evaluate()&&digitalRead(12)==HIGH&&digitalRead(11)==HIGH){
Serial.println("Success");
digitalWrite(13, HIGH);
The 12 and 11 are aleph magnetic contacts.So basically i want the led(13) to turn on when both the contacts are HIGH and the password is correct. Can someone tell me why isnt this working?
You can help us by showing the wiring, or you can debug this yourself by using Serial.println to print the values of digitalRead(11), digitalRead(12), and password.evaluate().
a magnetic contact is connected to pin 11 and ground(like the magnetic contact at 12) and a led is connected to pin 13 and ground. When the magnetic contact is HIGH it means that the electromagnet and the magnet are touching each other. And the led when it is HIGH it emmits light. Even though they are touching one another the led still doesnt turn on.
spycatcher2k:
What does your multi-meter measure on these pins?
Your comment made me figure out what i should have done. On void setup i should have put pin 12 and pin 11 to HIGH. So now its all good thanks all of you for your time