Using Servo with GPS module

Hi im trying to get a servo motor to work with the L80 gps module but the servo won't work, im using the Servo.h library and i cannot use any other library as they do not have position control. Please help me get these 2 to work together

Please read the forum guidelines to get information on what we need to know in order to help you.

What does that mean? What is the servo supposed to do? What does it really do?

Does the GPS get a lock?

Please post your code. Please read the forum guidelines to see how to properly post code and some information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

A wiring diagram may also be useful, please.

the servo moves and the gps doesn't get a lock. i don't know how a gps would lock? please answer my question how to get them to work together
this is what im using never mind the void loop:

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <Servo.h>

const int RXPin = 2, TXPin = 3;
const uint32_t GPSBaud = 9600; //Default baud of NEO-6M is 9600

Servo myservo;
int pos = 91 ;
TinyGPSPlus gps; // the TinyGPS++ object

SoftwareSerial mygps(RXPin, TXPin); // the serial interface to the GPS device
void setup() {
Serial.begin(9600);
mygps.begin(GPSBaud);
Serial.println(F("Arduino - GPS module"));
}
void loop() {}

I don't know exactly what you have. I don't know how you have it connected. I don't know how it is powered. I don't even know what Arduino board that you are using. The snippet of code that you posted is really no help.

Please read post #2 again.

On order to return a precise location the GPS must connect with multiple satellites. The data from the GPS is only valid when it has a lock. To have the best chance to get a lock you need to have the GPS antenna outdoors with a clear unobstructed view of a large portion of the sky. That means no heavy clouds, trees, or tall buildings.

The loop() function is empty. You never attempt to get data from the GPS and you never tell the servo to move. That is why they don't work.

What do you want the servo to do?

SoftwareSerial and the servo library conflict over timer usage. Try the ServorTimer2 library.

Make sure you have the servo and GPS working independently before trying to put the two together.

I already said never mind void loop if you would actually read what I said

Does servo timer have position control?

I have no idea what you are asking. Please rephrase.

To start with servo control, try the basic examples that come with the Arduino IDE. There are countless tutorials on line, as well.

Note: DO NOT try to power servos from the Arduino 5V pin, and ignore any tutorials that suggest this is OK. Use a 4xAA battery pack and connect the grounds.

if i move the servo with my hand will it go back to its original state is what i meant with servotimer2 as it uses time and not degrees.
thanks

Then you are doing something wrong.

For help, please read and follow the directions in the "How to get the best out of the forum" post. Post the details needed for forum members to understand and help solve the problem.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.