void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
// Wait for 3 seconds to ensure serial connection
delay(3000);
// Print a prompt to the Serial Monitor
Serial.println("Please enter two numbers separated by space:");
}
void loop() {
// Check if there is any serial input available
if (Serial.available() > 0) {
// Read in two integers from the Serial Monitor
int num1 = Serial.parseInt();
int num2 = Serial.parseInt();
// Print the numbers to the Serial Monitor
Serial.print("First number: ");
Serial.println(num1);
Serial.print("Second number: ");
Serial.println(num2);
// Prompt for another two numbers
Serial.println("Please enter two more numbers separated by space:");
}
}