gw.sendVariable - library question
-
Hi,
getting an example, gw.sendVariable was not recognized and i could not find it.
Any hint?
-
You should post the code you're trying to compile. But it looks like it is using an older version of MySensors. The object model with Sensor gw is deprecated now.
To send values to the gateway, you should use MyMessage messageName(CHILD_ID, V_type_of_message);
-
@boum thx, man. i was in doubt, so you confirmed that it's deprecated.
i was following the code:
void loop() { // Read digital motion value boolean motion = digitalRead( DIGITAL_INPUT_SENSOR ) == LOW; // Send debug output to serial monitor mprintln(PSTR("Motion sensor %s"), motion ? "ON" : "OFF" ); if (lastMotion != motion) { lastMotion = motion; // Send motion value to sensor gw.send( msg.set( motion ? "1" : "0" ) ); if (motion) { gw.sleep( SLEEP_TIME ); } } gw.sleep( INTERRUPT, CHANGE, SLEEP_TIME ); }
to use the motion sensor without interrupt (pin 2 or 3).
-
A guide for converting sketches using MySensors 1.5 to MySensors 2 is available at https://forum.mysensors.org/topic/4276/converting-a-sketch-from-1-5-x-to-2-0-x
3 out of 4
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Home Assistant/MySensors quirks
Development • 26 days ago • OldSurferDude 26 days ago -
MQTT-Help me understand about the MQTT Gateway.
Development • 2 Mar 2025, 01:44 • dpcons 12 Mar 2025, 23:39 -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
Gateway without a radio
Development • 12 Jan 2025, 23:19 • OldSurferDude 14 Jan 2025, 22:07 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59