Hi, when i add a delay to my servo it adds a delay to my gps readings
How do i fix this, my baud rate is 9600 and i cant seem to change that for some reason.
the problem lies here as when i lowered the delay to delay(50); the gps was working faster:
The problem is not the rest of the code it’s the delay from the servo and as long as I solve this or overwrite the gps it won’t work. How do I do solve this delay issue from the servo. The code which I have provided is where the issue is
You posted that lines of code that caused the not-functioning of the gps receiving
after you have added the delay(2000)
The solution is to
not
freeze the microcontroller completely.
executing a delay() stops ALL code-execution until delay-time is over
This is called blocking
Your code must be modified to be non-blocking
If you want to have a "delayed" moving of the servo in parallel to fast gps-receiving
this requires restructuring your code to be non-blocking and this is the reason why you should present the complete sketch.
The help can be much better taylored to your needs if you post your complete sketch.
If you prefer to keep your sketch a secret the more generalised advice has already been given
in this posting and in the other postings