const int blueB = 2; //button connected to pin 2
const int yellowB = 3; //button connected to pin 3
volatile int pintOne;
volatile int pintTwo;
void setup() {
attachInterrupt(digitalPinToInterrupt(blueB), handlerOne, CHANGE);
attachInterrupt(digitalPinToInterrupt(yellowB), handlerTwo, CHANGE);
pinMode(blueB, LOW);
pinMode(yellowB, LOW);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}
void loop() {
digitalWrite(8, pintOne);
digitalWrite(9, pintTwo);
}
void handlerOne() {
pintOne = digitalRead(blueB);
}
void handlerTwo() {
pintTwo = digitalRead(yellowB);
}