#include <ezButton.h>
int input;
byte i1;
byte i2;
int output;
byte buttons;
ezButton b1(3);
ezButton b2(4);
void setup() {
b1.setDebounceTime(20);
b2.setDebounceTime(20);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
Serial.begin(115200);
input=32767;
buttons=B00000000;
i1=lowByte(input);
i2=highByte(input);
output=(i2<<8)+i1;
}
void loop() {
b1.loop();
b2.loop();
// put your main code here, to run repeatedly:
if(b1.isPressed()){
buttons ^= B00000001;
}
if(b2.isReleased()){
buttons ^= B00000010;
}
if(buttons & B00000010){
Serial.print(1);
} else {
Serial.print(0);
}
Serial.print(",");
if(buttons & B00000001){
Serial.print(3);
} else {
Serial.print(2);
}
Serial.println(" ");
delay(10);
}