Arduino BT with Parallax GPS module

Im using the ArduinoBT with the Parallax GPS module.

I'm powering the board with just one 1.5V battery at the moment.
I wrote a small program to test if I can read the NMEA strings. The program checks if I can get the first character of the NMEA string ( first character = $). The GreenLed (pin 13) will turn on when the first character of the string is $, otherwise the RedLed(pin 12) is on.

The code is below:

#include <ctype.h>
#include <string.h>

int ledPinRed = 12;            //Led-On = if I dont get the $ char
int ledPinGreen = 13;         //Led-On = If I get the $
int rxPin = 0;                    //Serial Communication Pin Rx (Receive)
int txPin = 1;                    //Serial Communication Pin Tx (Transmit)
char buffer;                  
int incomingByte=-1;        
char check='

Im new at this and I have a few questions:

First of all, is my code ok?

Do you think the 1.5V supply is the reason my gps module doesnt seem to work? The "low-battery" led on the board is always on.

Should I use the NewSoftSerial Library for the communication?

I wonder if the board can get serial data, in my code with the SerialRead function.;                 //The first Valid Char of  a NMEA string

void setup()
{
Serial.begin(4800);
pinMode(ledPinRed,OUTPUT);
pinMode(ledPinGreen,OUTPUT);
pinMode(rxPin,INPUT);
pinMode(txPin,OUTPUT);

}
void loop()
{
digitalWrite(ledPinRed, HIGH);
digitalWrite(ledPinGreen, LOW);
incomingByte=Serial.read();
if (incomingByte == -1){
 delay(100);
                       }
else{
 if(incomingByte == check){
   digitalWrite(ledPinRed, LOW);
   digitalWrite(ledPinGreen, HIGH);
   delay(5000);    
                          }
   }
}


Im new at this and I have a few questions:

First of all, is my code ok?

Do you think the 1.5V supply is the reason my gps module doesnt seem to work? The "low-battery" led on the board is always on.

Should I use the NewSoftSerial Library for the communication?

I wonder if the board can get serial data, in my code with the SerialRead function.

Hi,

I cannot judge the quality of your code.
The board certainly communicates over the serial port.
Use the getting started Guide http://arduino.cc/en/Guide/ArduinoBT and you will be up and running over serial communication in no time.

Regarding the power, unless you haven't done so, pls refer to docs.cc.
To me 1.2V seems a bit low, add some juice as the GPS module needs some of it too. Maybe use a battery pack with 2-3 batteries providing 3V or 4.5V.

Good luck, Hans.

Hi Blank,

I was wondering if you ever got this working? I am trying the same thing now. Thanks.

-Thomasbot

You should use the Serial.available function to determine if there is data to read, before calling the read function.

You can also use Serial.print (and Serial.println) to print data to the Serial Monitor window, when the Arduino is connected to the computer, so that you can see all the data being read.