here's the code
/*
*/
int relay = 5;
int butt1 = 7;
int butt2 = 10;
void setup() {
pinMode(relay, OUTPUT);
pinMode(butt1, INPUT_PULLUP);
pinMode(butt2, INPUT_PULLUP);
}
void loop() {
if (digitalRead(butt1) and digitalRead(butt2) == LOW) {
digitalWrite(relay, HIGH);
delay(100);
}
else{
digitalWrite(relay, LOW);
delay(100);
}
}
the problem is that i want it to only turn on if all of the buttons are pressed but it turns on if even a single button is pressed