Sketch doesn't operate as expected?

Hello

Uno R3 on Windows 7 and 10, (Same symptoms on two computers)

Firstly I have no knowledge of code or programming, but am trying to learn with online tutorials.

I have built an electronic water drop device for photography and while the device seems to operate correctly, I am unable to input two of the question's that come up in the Serial Monitor.

it presents the 4 questions, but only allows me to input to two of them seemingly not waiting for two of the inputs?

This sketch was written and tested a couple of years ago by the author and I have no reason to doubt it is correct

I would very much appreciate some help, I am nearly seventy and I am afraid my capacity to learn new thing is a bit beyond me

Kind Regards

Paul

/* Water Drop Controller V4
/

//This is where we assign our Arduino pins and declare our variables

const int camPIN = 9; //Set camPIN (camera) to pin 9
const int solPIN = 10; //Set solPIN (soleniod valve) to pin 10

int DropOneSize; //1st drop size input variable (milliseconds)
int DropTwoSize; //2nd drop size input variable (milliseconds)
int SolDelay; //Set delay between drops (milliseconds)
int CamDelay; //Set delay between drops and camera activation (milliseconds)

void setup() {

//Here is where we turn on the serial monitor and tell the Arduino

Serial.begin(9600); //Start the Serial Monitor
pinMode (camPIN, OUTPUT); //Set camPIN to an output
pinMode (solPIN, OUTPUT); //Set solPIN to an output

//Here is where the time delays will be entered into the serial monitor

Serial.println(" "); //Print a space for ease of reading the text

Serial.println("Enter 1st drop size in milliseconds "); //Print text asking for 1st drop size
while(Serial.available()==0) {} //Wait for user input for 1st drop size
DropOneSize=Serial.parseInt(); //Read user input

Serial.println("Enter 2nd drop size in milliseconds "); //Print text asking for 2nd drop size
while(Serial.available()==0) {} //Wait for user input for 2nd drop size
DropTwoSize=Serial.parseInt(); //Read user input

Serial.println("Enter the delay between drops in milliseconds "); //Print text asking for time delay between drops
while(Serial.available()==0) {} //Wait for user input for delay between drops
SolDelay=Serial.parseInt(); //Read user input

Serial.println("Enter camera delay in milliseconds "); //Print text asking for camera delay
while(Serial.available()==0) {} //Wait for user input for camera delay
CamDelay=Serial.parseInt(); //Read user input

//This section will print the value entered above for clarity and record keeping

Serial.println(" "); //Print a blank line for neatness
Serial.print("1st drop size "); //Print 1st drop size
Serial.println(DropOneSize); //Print value DropOneSize
Serial.print("2nd drop size "); //Print 2nd drop size
Serial.println(DropTwoSize); //Print value DropTwoSize
Serial.print("Valve delay "); //Print Valve delay
Serial.println(SolDelay); //Print value SolDelay
Serial.print("Camera delay "); //Print Camera delay
Serial.println(CamDelay); //Print value CamDelay

}

void loop() {

//This next section is where we will use the times entered above to activate the solenoid and camera

digitalWrite (solPIN, HIGH); //Opens solenoid valve
delay (DropOneSize); //Valve stays open for time value DropOneSize - 1st drop size
digitalWrite (solPIN, LOW); //Closes solenoid valve
delay (SolDelay); //Time delay between drops
digitalWrite (solPIN, HIGH); //Opens solenoid valve
delay (DropTwoSize); //Valve stays open for time value DropTwoSize - 2nd drop size
digitalWrite (solPIN, LOW); //Closes solenoid valve

delay (CamDelay); //Time delay for camera activation

digitalWrite (camPIN, HIGH); //Sets camPIN to high - fires camera
delay (100); //Holds camPIN high for 100 milliseconds to ensure signal
digitalWrite (camPIN, LOW); //Sets camPIN to low -

delay (5000); //Delays the cycle for 5 seconds
}

The problem is most likely the way you have your serial monitor set up. Try setting the dropdown to “No line ending”.

I had actually just tested what wildbill suggests as likely: it is definitely the issue. It does present those symptoms if line end is not none.

Wild Bill and Jubukraa

Thank you so much, all now working, I would never have found that?

Paul

Good news. It’s one of those irritating things like breadboards with split ground and power busses; easy to spot if you’ve seen it before, invisible if you haven’t.

Thanks Widbill

As I said it is working now, even though at the bottom of the screen it reads in red

"You've pressed Send but nothing was sent, Should you select a line ending?"

I altered the inputs and its definitely sending?

As long as it is reporting the values you sent correctly, you needn't worry about it. If it bothers you, change the line ending to something else but stay away from sending carriage return AND line feed as that's what was causing your problem.

Thanks Wild Bill

I will have to live with it, as I don't know enough to change it

Paul

Are you by any chance double clicking the send button?