Compass and GPS fail

Help: I’m doing an automation robot project with a simple gps and a compass. However, after 30 minutes of use, the compass locks, having to be restarted and reconfigured. Does anyone know a possible solution for this? Gps blox 6m

No idea.

You will need to provide all the details of your setup, and the code you are using, if you want someone to help.

/*

  • Programa com bussola eletronica QMC5883
      • */

#include <Wire.h> //biblioteca para I2C
#include <MechaQMC5883.h> //biblioteca para o QMC5883

MechaQMC5883 qmc; //Objeto Criado

void setup() {
Wire.begin(); //Begin I2C communication
Serial.begin(9600); //Begin Serial Communication
qmc.init(); //Initialise the QMC5883 Sensor

}

void loop() {
int x,y,z;
qmc.read(&x,&y,&z); //carrega valores x y z

int Valor=atan2(x, y)/0.0174532925; //parametrizar eixo para graus

//converter em 360
if(Valor < 0)
Valor+=360;
Valor = 360-Valor;

Serial.println(Valor); //apresenta valores resultante

}

I am use GPS Blox NEO6m and Compass HMC5883l.

Post the code that has the problem. The posted code does not involve a GPS.

Hi, @fssarts
Welcome to the forum.

Please read the post at the start of any forum , entitled “How to use this Forum”.

To add code please click this link;

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks… Tom… :grinning: :+1: :coffee: :australia: