sleep() or smartsleep() in 2.0b MySensors

  • Hello,

    Has smartsleep been implemented in 2.0 or 2.0.1b?
    Did anyone use sleep function as below:

    int8_t sleep(int interrupt, int mode, unsigned long ms=0);
    int8_t smartSleep(int interrupt, int mode, unsigned long ms=0);

    I have a number of i2c sensors and I am getting data every 5 minutes or so. Also I am trying to combine lightning sensor sketch into it (IRQ is connected to D2 to interrupt). So how do I use the function to (1) sleep until D2 is interrupted and (2) sleep for 5 mins?

    In the setup for the lightning sensor I have :

    attachInterrupt(digitalPinToInterrupt(IRQ_pin), alert, RISING);

    I suppose I need a sleep function at the end of loop like this:

    sleep(IRQ_PIN, CHANGE, 5*60000);

    Can anyone confirm this is how this function is now used please?

Log in to reply

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.