|
MySensors Library & Examples
2.3.2-62-ge298769
|
55 #define MY_RS485_DE_PIN 2
58 #define MY_RS485_BAUD_RATE 9600
65 uint32_t SLEEP_TIME = 120000;
66 #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
67 #define CHILD_ID 1 // Id of the sensor child
74 pinMode(DIGITAL_INPUT_SENSOR, INPUT);
89 bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) ==
HIGH;
91 Serial.println(tripped);
95 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.