Jugaadu's Mother has bought a piece of new gold jewellery set for herself. She kept them in her Safe box. To make it safer, Jugaadu wants to have an alarm system which gives an alarm on being touched by someone else. How can Jugaadu make a secure Locker?
int led_pin=13;
int sig_pin=7;
void setup(){
pinMode(led_pin,OUTPUT);
pinMode(sig_pin,INPUT);
}
void loop() {
if(digitalRead(sig_pin))
{
digitalWrite(led_pin,HIGH);
}
else{
digitalWrite(led_pin,LOW);
}
}