So I am trying to use a GPS on a different pin and than send the info to the serial monitor when I do this I get no data, I use the NewSoftSerial to use pins 2,3 with DLINE selected. I am using a Arduino Duemilanova 328.
Here is what I have tried:
#include <NewSoftSerial.h>
const int rxpin = 2;
const int txpin = 3;
NewSoftSerial serial_gps(txpin, rxpin);
void setup()
{
serial_gps.begin(4800);
Serial.begin(115200);
Serial.print("please Work");
}
void loop()
{
if (serial_gps.available() > 0)
{
char c = serial_gps.read();
Serial.print(c, BYTE);
}
}
also:
#include <NewSoftSerial.h>
const int rxpin = 2;
const int txpin = 3;
NewSoftSerial serial_gps(txpin, rxpin);
//byte aa;
void setup()
{
serial_gps.begin(4800);
Serial.begin(9600);
}
void loop()
{
if (serial_gps.available())
{
byte aa = serial_gps.read();
Serial.print(aa, BYTE);
}
}
The only one that gives me any data is when I am communicating with the Serial directly Like this:
byte aa;
void setup()
{
Serial.begin(4800); // the module runs at 4800 bps, not 9600!
}
void loop()
{
if (Serial.available()) // if there is data coming into the serial line
{
byte aa = Serial.read(); // get the byte of data
Serial.print(aa, BYTE); // send it to the serial monitor
}
}
If anyone could help It would be much appreciated
Thanks