|
MySensors Library & Examples
2.3.2-62-ge298769
|
42 uint32_t SLEEP_TIME = 120000;
43 #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
44 #define CHILD_ID 1 // Id of the sensor child
51 pinMode(DIGITAL_INPUT_SENSOR, INPUT);
66 bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) ==
HIGH;
68 Serial.println(tripped);
72 sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
bool sendSketchInfo(const char *name, const char *version, const bool requestEcho=false)
void presentation()
Node presentation.
MyMessage & set(const void *payload, const size_t length)
Set entire payload.
bool send(MyMessage &msg, const bool requestEcho=false)
bool present(const uint8_t sensorId, const mysensors_sensor_t sensorType, const char *description="", const bool requestEcho=false)
void setup()
Called after node initialises but before main loop.
int8_t sleep(const uint32_t sleepingMS, const bool smartSleep=false)
API declaration for MySensors.
MyMessage is used to create, manipulate, send and read MySensors messages.