send(msg(double)); gives an error
-
I have defiened a MyMessage as this:
MyMessage msgSpeed(WIND_CHILD_ID, V_WIND);
Present it like this:
present(WIND_CHILD_ID, S_WIND);
And I get an error for this row since windSpeed is a double.
send(msgSpeed.set(windSpeed));
Get the error message:
Wind:94: error: call of overloaded 'set(double&)' is ambiguousIs it so that I can't send anything other than an INT for windspeed?
-
@Martin-Tellblom It depends on the type of the variable (windspeed) you are trying to send how you send it. sometimes you need to specify decimals. See below taken from the API
// Setters for payload MyMessage& set(void* payload, uint8_t length); MyMessage& set(const char* value); MyMessage& set(uint8_t value); MyMessage& set(float value, uint8_t decimals); MyMessage& set(unsigned long value); MyMessage& set(long value); MyMessage& set(unsigned int value); MyMessage& set(int value);
-
Thank you @AWI , I missed that one.
1 out of 3
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Adding Listen only device to my system.
Development • 26 Feb 2025, 00:39 • dpcons 26 Feb 2025, 06:26 -
Home Assistant/MySensors quirks
Development • 17 Mar 2025, 02:35 • OldSurferDude 17 Mar 2025, 02:35 -
PJON and Minicore not working
Development • 21 Mar 2025, 19:51 • Trand 21 Mar 2025, 19:51 -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23