 |
MySensors Library & Examples
2.3.2
|
41 uint32_t SLEEP_TIME = 120000;
42 #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
43 #define CHILD_ID 1 // Id of the sensor child
50 pinMode(DIGITAL_INPUT_SENSOR, INPUT);
65 bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) ==
HIGH;
67 Serial.println(tripped);
71 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.