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 serial monitor
Serial.println("Please enter two numbers seperated by space:");
}
void loop() {
//check if there is any special input available
if(Serial.available()>0){
//read in two integers from serial monitor
int num1 = Serial.parseInt();
int num2 = Serial.parseInt();
//print numbers to 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 seperated by space: ");
}
}