Hello Ray, thank you so much for your time, its really appreciated.
Here is my previous code without the Boundaries:
#include <TinyGPS.h>
// This program shown how to control arduino from PC Via Bluetooth
// Connect ...
// arduino>>bluetooth
// D11 >>> Rx
// D10 >>> Tx
// you will need arduino 1.0.1 or higher to run this sketch
#include <SoftwareSerial.h>// import the serial library
TinyGPS gps;
SoftwareSerial ss
(10, 11); // RX, TX
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop()
{
// put your main code here, to run repeatedly:
//Serial.println("To receive bluetooth coordinates, press 1");
delay(5000);
if (Serial.available()){
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;
// For one second we parse GPS data and report some key values
for (unsigned long start = millis(); millis() - start < 1000;)
{
while (ss.available())
{
char c = ss.read();
Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}
if (newData)
{
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Serial.print("LAT=");
Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Serial.print(" LON=");
Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
Serial.print(" SAT=");
Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
Serial.print(" PREC=");
Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
}
gps.stats(&chars, &sentences, &failed);
Serial.print(" CHARS=");
Serial.print(chars);
Serial.print(" SENTENCES=");
Serial.print(sentences);
Serial.print(" CSUM ERR=");
Serial.println(failed);
if (chars == 0)
Serial.println("** No satellites connected **");
}
}
I have just added your modification to the above code and still doesn't seem to write anything to the display.
Here is modified code:
#include <TinyGPS.h>
// This program shown how to control arduino from PC Via Bluetooth
// Connect ...
// arduino>>bluetooth
// D11 >>> Rx
// D10 >>> Tx
// you will need arduino 1.0.1 or higher to run this sketch
#include <SoftwareSerial.h>// import the serial library
TinyGPS gps;
SoftwareSerial ss
(10, 11); // RX, TX
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop()
{
// put your main code here, to run repeatedly:
//Serial.println("To receive bluetooth coordinates, press 1");
delay(5000);
if (Serial.available()){
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;
unsigned endLoopTime = millis() + 1000; // Spend up to 1,000 ms in the loop
// newData previously set to false in your program
while ( (millis() < endLoopTime) && (!newData) )
{
if (ss.available())
{
char c = ss.read();
Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}
if (newData)
{
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Serial.print("LAT=");
Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Serial.print(" LON=");
Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
Serial.print(" SAT=");
Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
Serial.print(" PREC=");
Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
}
gps.stats(&chars, &sentences, &failed);
Serial.print(" CHARS=");
Serial.print(chars);
Serial.print(" SENTENCES=");
Serial.print(sentences);
Serial.print(" CSUM ERR=");
Serial.println(failed);
if (chars == 0)
Serial.println("** No satellites connected **");
}
}
Your modification to the boundaries makes more sense thank you, i did just add that part too but i got an error 'expected '{' befour 'if' ' but we can surely sort that out after we get the rest of the code to work again.
That the second person to comment about the software serial, is that a possible cause for the problem?
and thank you brad.