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. Binary button must lock after using

Binary button must lock after using

Scheduled Pinned Locked Moved General Discussion
4 Posts 3 Posters 691 Views 2 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.
  • DickD Offline
    DickD Offline
    Dick
    wrote on last edited by
    #1

    Can anybody help how to get a Binary button in a sleep mode and cannot be used for 15 min. After 15min the button works again.

    1 Reply Last reply
    0
    • nagelcN Offline
      nagelcN Offline
      nagelc
      wrote on last edited by
      #2

      If your node is not battery powered, and you don't need to sleep the node, then you can just check the time with millis() and ignore button presses until the 15 minutes has passed.
      If you are running on battery and want to sleep the node to conserve power, I think this will be challenging, because millis() doesn't work for sleeping nodes.
      You could add a real time clock to your node. Then you could check the RTC for the time.
      If you want to sleep 15 minutes from the last button press, you could just sleep the node 15 min. Then you can check if the node woke from sleep due to button press or due to time and ignore the button press. But that is probably not what you are looking for. If someone pressed the button say, every 5 minutes, it would reset the clock each time and never wake up.
      You could also use one of the newer processors like the NRF5 series which can keep track of time while sleeping.

      1 Reply Last reply
      0
      • skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by skywatch
        #3

        You could use an interrupt for the button. When the button is pressed the interrupt is disconnected and the node waits 15 min, then re-enables the button interrupt and goes to sleep - You don't say how often you are expecting the button to be pushed...?

        1 Reply Last reply
        0
        • nagelcN Offline
          nagelcN Offline
          nagelc
          wrote on last edited by
          #4

          Duh .. . yeah . ... like @skywatch said.

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


          8

          Online

          11.7k

          Users

          11.2k

          Topics

          113.0k

          Posts


          Copyright 2019 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