Hello.
I have wind sensor connected to my Arduino and i use TinyGPS++ library
I use custom fields to get a date
TinyGPSPlus gps;
TinyGPSCustom WindDirection(gps, "WIMWV", 1);
TinyGPSCustom WindSpeed(gps, "WIMWV", 3);
TinyGPSCustom Temperature(gps, "YXXDR", 2);
If i want to print it - i use code:
Serial.print(F("Wind direction = ")); Serial.print(WindDirection.value());
Serial.print(F(" Wind speed (knots), = ")); Serial.print(WindSpeed.value());
Printing ok, with decimal point.
But if i try this
// variable declaration
int Wind_SPD=0;
int Wind_DIR=0;
--------------------------
IN MAIN LOOP
-------------------------
if (WindDirection.isUpdated())
{
MyStatus=100;
Wind_SPD=round(WindSpeed.value);
Wind_DIR=round(WindDirection.value);
}
[code]
I have a error:
[i]wind_1_0.ino: In function 'void loop()':
wind_1_0:104: error: invalid use of member (did you forget the '&' ?)
wind_1_0:104: error: invalid use of member (did you forget the '&' ?)
wind_1_0:104: error: invalid use of member (did you forget the '&' ?)
wind_1_0:105: error: invalid use of member (did you forget the '&' ?)
wind_1_0:105: error: invalid use of member (did you forget the '&' ?)
wind_1_0:105: error: invalid use of member (did you forget the '&' ?)[/i]
If i try this:
[code]
if (WindDirection.isUpdated())
{
MyStatus=100;
Wind_SPD=int(WindSpeed.value);
Wind_DIR=int(WindDirection.value);
}
i have a error:
wind_1_0:105: error: invalid use of member (did you forget the '&' ?)
And if i try this
if (WindDirection.isUpdated())
{
MyStatus=100;
Wind_SPD=round(WindSpeed);
Wind_DIR=round(WindDirection);
}
i have a error
wind_1_0.ino: In function 'void loop()':
wind_1_0:104: error: no match for 'operator>=' in 'WindSpeed >= 0'
wind_1_0:104: error: no match for 'operator+' in 'WindSpeed + 5.0e-1'
wind_1_0:104: error: no match for 'operator-' in 'WindSpeed - 5.0e-1'
wind_1_0:105: error: no match for 'operator>=' in 'WindDirection >= 0'
wind_1_0:105: error: no match for 'operator+' in 'WindDirection + 5.0e-1'
wind_1_0:105: error: no match for 'operator-' in 'WindDirection - 5.0e-1'
So...
How i can get a integer value from custom field returned by TINy GPS ++
Thanks.
Sorry my bad english[/code][/code]