Arduino Serial User input

Hello World ;
I am new Arduino user I am trying to do a very simple project the circuit contains 2 LEDs on is red and other is yellow and the user supposed to enter how many time each LED should blinks so I used this code multiple times no help on Arduino IDE 1.8.19 ( Latest release ) somehow it worked perfectly on Arduino IDE 1.5.4R2 which is so annoying my question how do I prompt the user to enter multiple value using serial in this release please help

int redLEDPin=9; //Declare redLEDPin an int, and set to pin 9 
int yellowLEDPin=10; //Declare yellowLEDPin an int, and set to pin 10 
int redOnTime=250; //Declare redOnTime an int, and set to 250 mseconds 
int redOffTime=250; //Declare redOffTime an int, and set to 250 
int yellowOnTime=250; //Declare yellowOnTime an int, and set to 250
int yellowOffTime=250; //Declare yellowOffTime an int, and set to 250
int numYellowBlinks; //Number of times to blink yellow LED
int numRedBlinks;  //Number of times to blink red LED
String redMessage="The Red LED is Blinking"; //Declaring a String Variable 
String yellowMessage= "The Yellow LED is Blinking"; //Declaring a String Variable
 
void setup() {
  Serial.begin(115200);        // Turn on the Serial Port
  pinMode(redLEDPin, OUTPUT);  // Tell Arduino that redLEDPin is an output pin
  pinMode(yellowLEDPin, OUTPUT);  //Tell Arduino that yellowLEDPin is an output pin
  
  Serial.println("How Many Times Do You Want the Red LED to Blink? "); //Prompt User for Input
  while (Serial.available()==0){ }  //Wait for User Input
  numRedBlinks = Serial.parseInt(); //Read User Input
 
  Serial.println("How Many Times Do You Want the Yellow LED to Blink? "); //Prompt User for Input
  while (Serial.available()==0){ } //Wait for Input
  numYellowBlinks = Serial.parseInt(); //Read User Input
}
 
void loop() {
 
  Serial.println(redMessage);
  for (int j=1; j<=numRedBlinks; j=j+1) {     // Start our for loop
    Serial.print("   You are on Blink #: ");
    Serial.println(j);
    digitalWrite(redLEDPin,HIGH); //Turn red LED on
    delay(redOnTime);             //Leave on for redOnTime
    digitalWrite(redLEDPin,LOW);  //Turn red LED off
    delay(redOffTime);            //Leave off for redOffTime
}
  Serial.println(" ");
  Serial.println(yellowMessage);
  for (int j=1; j<=numYellowBlinks; j=j+1) {     // Start our for loop
    Serial.print("   You are on Blink #: ");
    Serial.println(j);
    digitalWrite(yellowLEDPin,HIGH); //Turn yellow LED on
    delay(yellowOnTime);             //Leave on for yellowOnTime
    digitalWrite(yellowLEDPin,LOW);  //Turn yellow LED off
    delay(yellowOffTime);            //Leave off for yellowOffTime
}
Serial.println(" ");
}

Capture.PNG

Where did you find that magical Arduino version? Latest released version is 1.8.8...

Kshehab91’s picture:
e191491c72691552e3729a8aec602f02ae2f48d3.png

Please explain exactly what you mean by “no help on Arduino IDE 1.8.19”.

What is the behavior you expect?

What unexpected behavior are you experiencing instead of the intended behavior?

I notice you still haven’t fixed the bug pointed out to in your previous thread:
http://forum.arduino.cc/index.php?topic=591687.msg4023951#msg4023951

ok thank you guys for your support after a lot search it seems that i must Select " No line ending " in the serial monitor options .

Best Regards

Nice work discovering the solution for your self. I was 99% sure that was the problem but I wanted to wait for a better description to make sure I wasn't taking us off on a tangent.

I suspect the reason you had different results between two versions of the Arduino IDE was simply that you had the line ending option set differently in Serial Monitor between the two version, rather than that there was actually a difference in the workings of the IDE versions.

Requiring that "No line ending" be selected in Serial Monitor is one solution. It is also possible to write your code so that it will work with any line ending setting.

Downloaded arduino 1.8.8 on to ubuntu 16.04 , but can't get it to install. Before all I had to do was double click on the folder and it practically installed itself. It comes up with a script for installing, but doesn't install. I've got the blue icon, but when I click on it I get an error message that says can't launch. I never see a permission screen that says you have to agree before you install.
I've tried removing and download several times but still no success. What am I doing wrong? Jim E.

jimez1000:
I get an error message that says can't launch

Please post the exact and complete text of the error message.