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. Development
  3. Detect who wake up sensor .. INT0,INT1 or timeout..

Detect who wake up sensor .. INT0,INT1 or timeout..

Scheduled Pinned Locked Moved Development
4 Posts 2 Posters 1.9k 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.
  • D Offline
    D Offline
    dzairo
    wrote on last edited by
    #1

    Hi.
    I tested **Binary Sensor Sleep ** and working ... Is there any way how to check that wake up sensor from Timeout setting value or from INT1 , INT0??
    I want every 1 minutes wake up and send info about sensor (battery , temperature) to serial gateway ..

    regards.

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2
      /**
      	 * Sleep (PowerDownMode) the Arduino and radio. Wake up on timer or pin change.
      	 * See: http://arduino.cc/en/Reference/attachInterrupt for details on modes and which pin
      	 * is assigned to what interrupt. On Nano/Pro Mini: 0=Pin2, 1=Pin3
      	 * @param interrupt Interrupt that should trigger the wakeup
      	 * @param mode RISING, FALLING, CHANGE
      	 * @param ms Number of milliseconds to sleep or 0 to sleep forever
      	 * @return true if wake up was triggered by pin change and false means timer woke it up.
      	 */
      	bool sleep(uint8_t interrupt, uint8_t mode, unsigned long ms=0);
      
      	/**
      	 * Sleep (PowerDownMode) the Arduino and radio. Wake up on timer or pin change for two separate interrupts.
      	 * See: http://arduino.cc/en/Reference/attachInterrupt for details on modes and which pin
      	 * is assigned to what interrupt. On Nano/Pro Mini: 0=Pin2, 1=Pin3
      	 * @param interrupt1 First interrupt that should trigger the wakeup
      	 * @param mode1 Mode for first interrupt (RISING, FALLING, CHANGE)
      	 * @param interrupt2 Second interrupt that should trigger the wakeup
      	 * @param mode2 Mode for second interrupt (RISING, FALLING, CHANGE)
      	 * @param ms Number of milliseconds to sleep or 0 to sleep forever
      	 * @return Interrupt number wake up was triggered by pin change and negative if timer woke it up.
      	 */
      	int8_t sleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2, uint8_t mode2, unsigned long ms=0);
      
      
      1 Reply Last reply
      0
      • D Offline
        D Offline
        dzairo
        wrote on last edited by
        #3

        Hi.
        Then in Loop declare new wariable for example : static int8_t wakeup;
        and do this : wakeup=sensor_node.sleep(...); and test if less then 0 then timeout or more then 0 are INT0 or INT1
        is it right??

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          yep! :thumbsup:

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


          27

          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