Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. sleep() or smartsleep() in 2.0b MySensors

sleep() or smartsleep() in 2.0b MySensors

Scheduled Pinned Locked Moved General Discussion
1 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • alexsh1A Offline
    alexsh1A Offline
    alexsh1
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    14

    Online

    11.7k

    Users

    11.2k

    Topics

    113.1k

    Posts


    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • MySensors
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular