// Define the input pin numbers
const int switchPin1 = 3;
const int switchPin2 = 2;
void setup() {
// Set the switch pins as inputs
pinMode(switchPin1, INPUT);
pinMode(switchPin2, INPUT);
// Initialize Serial communication
Serial.begin(9600);
}
void loop() {
// Read the state of the switches
int state1 = digitalRead(switchPin1);
int state2 = digitalRead(switchPin2);
// Convert the states to a 2-bit binary value
int combination = (state2 << 1) | state1;
// Print the combination to the Serial Monitor
Serial.println(combination);
{
delay(2000);
}
}