HardwareSerial.h and LX200

Hey there! I'm trying to solve a problem. I'm using an Arduino Due.

My aim is to write a code using the standard protocol for telescopes LX200 (which uses HardwareSerial.h). I have both the file .h and .cpp, and I'm trying to modify them.

Inside the .cpp file, I need to record data from the serial monitor.
So for example I print a message using printf, as printf("Insert first coordinate: "). But how can I save those data?

I tried with scanf(%d,&FirstCoordinate), but it doesn't work, as well as cout&cin, gets() and Serial.read().

How can I do? I'm desperate.

I have both the file .h and .cpp, and I'm trying to modify them.

I strongly discourage you to modify HardwareSerial.h or HardwareSerial.cpp. Why do you think you have to modify any of these files?

Inside the .cpp file, I need to record data from the serial monitor.
So for example I print a message using printf, as printf("Insert first coordinate: "). But how can I save those data?

We don't know as you failed to post your code. Don't forget to use code tags when posting code! The sticky post at the top of the topic ("How to use this forum - please read") explains what that mean.

Together with the code post details about the problem. What do you expect the code to do and what result did you get?

No, I have to modify LX200.cpp and LX200.h, not the HardwareSerial one.
I want that on the serial monitor I read "Insert coordinate x", and after I insert the coordinate I want that the number is stored in a variable a, for example.

No, I have to modify LX200.cpp and LX200.h, not the HardwareSerial one.

I haven't seen that code yet. Same is true for the wiring diagram. Did you really read the post mentioned above?