bmkaya
February 10, 2017, 1:57pm
1
Hello,
I want to use GPS and IMU modules with Arduino. I found a program which shows GPS valuesI use the following programs for GPS and main. But I could not take GPS values they always show 0. When use the basic program for the GPS, I take all parameters for GPS.
Can anyone help me ?
GPS_Tiny.ino (1.38 KB)
Waveshare_Deneme3.ino (5.98 KB)
system
February 10, 2017, 4:39pm
2
gps.encode(altserial.read());
The encode method returns a value. Why do you ignore it?
while (!intFlag);
It is absolutely pointless to use interrupts, and then bury your head in the sand until the interrupt happens.
bmkaya
February 10, 2017, 6:09pm
3
Thanks for your answer, but I could not understand exactly where I will put this command and which interrupt will I use ?
bmkaya
February 10, 2017, 7:04pm
4
I checked the steps in following program and I saw that the program goes never step "2" ? why?
void gprmcOku()
{
Serial.println("1");
while(altserial.available())
{
Serial.println("2");
gps.encode(altserial.read());
}
Serial.println("3");
if(gps.location.isUpdated())
{
Serial.println("4");
boylam = (gps.location.lng()) * 1000000;
enlem = (gps.location.lat()) * 1000000;
}
}
I would guess that the while here is never true:
Serial.println("1");
while(altserial.available())
{
}
so the action in the braces { } never execute.
Does the program print 1 and then go on to print 3?
bmkaya
February 10, 2017, 7:51pm
6
Yes,
Program goes to step 3 after step 1.
system
February 10, 2017, 11:55pm
7
Then whatever is connected to the AltSoftSerial pins is not connected correctly (wires crossed?) or is not powered or is not working.
system
February 10, 2017, 11:57pm
8
which interrupt will I use ?
None. Why are you using interrupts, anyway? If you are going to just sit around and do nothing anyway, there is no reason to use interrupts. They are so that you CAN do other things, and not worry about missing a critical event.
bmkaya
February 11, 2017, 10:35am
9
Is altSerial.available() command an interrupt ? If yes, the software must go step2 but never goes to step2 , why?
system
February 11, 2017, 1:47pm
10
Is altSerial.available() command an interrupt ?
No. It simply returns the number of characters in the incoming serial buffer.