gw.sendVariable - library question
Development
4
Posts
3
Posters
19
Views
3
Watching
-
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); -
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).