Skip to main content
Typo's
Source Link
stUrb
  • 351
  • 2
  • 5
  • 10

new to arduino I'm struggling with what sounds like fairly n00b problem... I've wired up a adafruit GPS-board to my Arduino and it is working as it spits out GPS data to the serial port with Serial.print(GPS.latitude, DEC)

I Now want to concat a string which I can process (read: I want to sent it via an ethernet client.) This is what I got already:

......
String vnnt = "$VNNT,";

if (GPS.fix) {
   vnnt += "GPS,";

   //this works:
   vannutvnnt.concat(GPS.fix);
  
   //but this not:
   vnnt.concat(GPS.latitude);

}else{
   vnnt += "INFO,Acquiring Sats";
}

Serial.println(vnnt);

The error message is: Call of overloaded 'concat(float&)' is ambiguous When I Serial.print(GPS.latitude, DEC) it results in: 4418.5937996050

So it is probably to big or something...

How can I concat the vars and create the long string?

new to arduino I'm struggling with what sounds like fairly n00b problem... I've wired up a adafruit GPS-board to my Arduino and it is working as it spits out GPS data to the serial port with Serial.print(GPS.latitude, DEC)

I Now want to concat a string which I can process (read: I want to sent it via an ethernet client.) This is what I got already:

......
String vnnt = "$VNNT,";

if (GPS.fix) {
   vnnt += "GPS,";

   //this works:
   vannut.concat(GPS.fix);
  
   //but this not:
   vnnt.concat(GPS.latitude)

}else{
   vnnt += "INFO,Acquiring Sats";
}

Serial.println(vnnt);

The error message is: Call of overloaded 'concat(float&)' is ambiguous When I Serial.print(GPS.latitude, DEC) it results in: 4418.5937996050

So it is probably to big or something...

How can I concat the vars and create the long string?

new to arduino I'm struggling with what sounds like fairly n00b problem... I've wired up a adafruit GPS-board to my Arduino and it is working as it spits out GPS data to the serial port with Serial.print(GPS.latitude, DEC)

I Now want to concat a string which I can process (read: I want to sent it via an ethernet client.) This is what I got already:

......
String vnnt = "$VNNT,";

if (GPS.fix) {
   vnnt += "GPS,";

   //this works:
   vnnt.concat(GPS.fix);
  
   //but this not:
   vnnt.concat(GPS.latitude);

}else{
   vnnt += "INFO,Acquiring Sats";
}

Serial.println(vnnt);

The error message is: Call of overloaded 'concat(float&)' is ambiguous When I Serial.print(GPS.latitude, DEC) it results in: 4418.5937996050

So it is probably to big or something...

How can I concat the vars and create the long string?

Source Link
stUrb
  • 351
  • 2
  • 5
  • 10

How to build (concat) a string with big numbers

new to arduino I'm struggling with what sounds like fairly n00b problem... I've wired up a adafruit GPS-board to my Arduino and it is working as it spits out GPS data to the serial port with Serial.print(GPS.latitude, DEC)

I Now want to concat a string which I can process (read: I want to sent it via an ethernet client.) This is what I got already:

......
String vnnt = "$VNNT,";

if (GPS.fix) {
   vnnt += "GPS,";

   //this works:
   vannut.concat(GPS.fix);
  
   //but this not:
   vnnt.concat(GPS.latitude)

}else{
   vnnt += "INFO,Acquiring Sats";
}

Serial.println(vnnt);

The error message is: Call of overloaded 'concat(float&)' is ambiguous When I Serial.print(GPS.latitude, DEC) it results in: 4418.5937996050

So it is probably to big or something...

How can I concat the vars and create the long string?