bool test = true;
bool test2 = true;
void setup() {
// put your setup code here, to run once:
DDRD |= 1<<2;
DDRB |= 1<<0;
pinMode(13, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(13) == LOW && test == true)
{
PORTD &= ~(1<<2);
PORTB |= 1<<0;
test = false;
}
if(digitalRead(12) == LOW && test2 == true)
{
PORTD |= (1<<2);
PORTB |= (1<<0);
test2 = false;
}
else if (digitalRead(13) != LOW && test != true)
{
test = true;
}
else if (digitalRead(12) != LOW && test2 != true)
{
test = true;
}
}