Part of the problem is that the
delay function[
^] stops your program runnign for the ammount of time you specify - 500ms or half a second. And you call it twice in quick succession, so it only checks the buttons quickly once a second. So you can't just "push the buttons" - you have to hold them down.
And when you do, you code doesn't do what you think, because:
if ( taster_status_1 == HIGH) {
taster1_off = 1;
} else if ( taster_status_2 == HIGH) {
taster2_off = 1;
}
means that is teh first button is pressed, it never checks the other, and so
this test will always fail:
if (taster1_off == 1 and taster2_off == 1){
Take out the
else
and it should work:
if ( taster_status_1 == HIGH) {
taster1_off = 1;
}
if ( taster_status_2 == HIGH) {
taster2_off = 1;
}