gw.sendVariable - library question
-
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).
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login