Hi,
I have a Arduino Duemilanove connected to a Libelium GPS (http://www.libelium.com/tienda/catalog/product_info.php?cPath=21&products_id=37).
I am accessing the GPS through the LB_GPS library Version 01a
I am developing a small program (I am quite noob with Arduino) to read the data from the GPS and to show it in a LCD display.
While I am connected to the computer through the USB port the GPS seems to work fine, I receive NMEA strings as expected.
The problem comes when I want to power the system through batteries, not through the USB port.
I disconnect the USB cable, reset the Arduino and everything goes running until the program tries to read data from the GPS. Then it is blocked.
The following code shows what happens: working with a USB connection you can see at the display the strings "GETRAW IN" and "GETRAW OUT" swapping every 5 seconds approx.
When the Arduino is powered through batteries the display shows one time "GETRAW IN" and the program hangs.
Any idea on where is the problem?
Thanks in advance
#include <LiquidCrystal.h>
#include <LB_GPS.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
void setup()
{
GPS.init();
delay(100);
lcd.begin(16,2);
}
void loop()
{
Visualiza("GETRAW IN ");
GPS.getRaw(100); // reads the GPS string and stores it in inBuffer
Visualiza("GETRAW OUT ");
}
void Visualiza(const char *s1)
{
lcd.setCursor(0,0);
lcd.print(s1);
lcd.setCursor(0,1);
lcd.print(" ");
delay(5000);
}