Execute function in sensor
-
Hello,
I have a sensor with a number of predefined functions. Now I want to be able to execute the functions by sending a command to the sensor. Is this possible?
For instance I have the following functions:
void colorWipe1(uint16_t c, uint8_t wait) { do something } void colorWipe2(uint16_t c, uint8_t wait) { do something }
When I send a command to the sensor I want it to run the function I have addressed in my command.
What sensor type should I use and how do I execute the correct incoming command?Thanks!
-
Sensor type doesn't really matter. You could use S_CUSTOM for this type of thing.
Then just register a callback for incoming messages where you handle functions-calls depending on message received.
-
Thank you hek! I actually got it to work exactly the way I want.
1 out of 3
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23 -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
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 -
Home Assistant/MySensors quirks
Development • 17 Mar 2025, 02:35 • OldSurferDude 17 Mar 2025, 02:35