Reading the serial monitor

Hello, I have Arduino mega 2560 and I wonder if there is any way to use the serial monitor screen
to save values in parameters, something like Console.ReadLine(); at C#.
There is any way to do that?

You'll have to do a better job of explaining your question. You can print to the Serial Monitor via Serial.print(), etc. You can read input from the Serial Monitor via Serial.read(), etc. You'll find documentation on this and much more in the reference: https://www.arduino.cc/en/Reference/Serial

You’ll have to do a better job of explaining your question. You can print to the Serial Monitor via Serial.print(), etc. You can read input from the Serial Monitor via Serial.read(), etc. You’ll find documentation on this and much more in the reference:
https://www.arduino.cc/en/Reference/Serial

That was the code that I have uploaded my arduino with.

void setup() {
  Serial.begin(9600);
  Serial.println("Start");
  String a = "";
  a = Serial.read();
  Serial.println(a);
  
}

It didn’t work all the comments that were at the Serail monitor dialog was:

Start
-1

I tried to send a command to the monitor and see if it’ll print that, but as you can see it just printed -1 before I even sent the command.
The kind of function that I was looking for is something that will wait until I will send it a certain value through the serial monitor, like I said something like Console.ReadLine() at C#

You need to spend some time reading the reference pages at the link in my last reply.

dindibo4: The kind of function that I was looking for is something that will wait until I will send it a certain value through the serial monitor

There are multiple functions that do things like that. You should never do a Serial.read() without first verifying that there is data available vial Serial.available().

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

I am assuming you are trying to send data to the Arduino from the Serial Monitor. If I have got that wrong please say so.

...R

Start with the basics

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  while (Serial.available() == 0)
  {
    //do nothing until there is something to read
  }
  char inChar = Serial.read();  //read each available character
  Serial.println(inChar);  //print each character read
}

Then look at Robin's thread