Arduino BT with Parallax GPS module


im using arduinobt parallax gps module.





i'm powering board 1 1.5v battery @ moment.
i wrote small program test if can read nmea strings. program checks if can first character of nmea string ( first character = $). greenled (pin 13) turn on when first character of string $, otherwise redled(pin 12) on.

the code below:

code: [select]

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

int ledpinred = 12;            //led-on = if dont $ char
int ledpingreen = 13;         //led-on = if $
int rxpin = 0;                    //serial communication pin rx (receive)
int txpin = 1;                    //serial communication pin tx (transmit)
char buffer;                  
int incomingbyte=-1;        
char check='$';                 //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 @ , have few questions:

first of all, code ok?

do think 1.5v supply reason gps module doesnt seem work? "low-battery" led on board on.

should use newsoftserial library communication?

i wonder if board can serial data, in code serialread function.

hi,

i cannot judge quality of code.
the board communicates on serial port.
use getting started guide http://arduino.cc/en/guide/arduinobt , , running on serial communication in no time.

regarding power, unless haven't done so, pls refer http://arduino.cc/en/main/arduinoboardbluetooth.
to me 1.2v seems bit low, add juice gps module needs of too. maybe use battery pack 2-3 batteries providing 3v or 4.5v.

good luck, hans.


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Arduino BT with Parallax GPS module


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums