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. gw.sleep and debounce?

gw.sleep and debounce?

Scheduled Pinned Locked Moved Development
4 Posts 3 Posters 2.6k 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.
  • stevebusS Offline
    stevebusS Offline
    stevebus
    wrote on last edited by
    #1

    Hi all,

    Forgive me if this is a FAQ... A forum search came up empty

    Typically, with pre-mysensors sketches, I would use the debounce library to debounce button presses that cause interrupts. Is that still necessary with gw.sleep? or does it internally debounce the button press when the interrupt is generated before it returns to the caller?

    --Steve

    Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

    Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

    1 Reply Last reply
    0
    • TheoLT Offline
      TheoLT Offline
      TheoL
      Contest Winner
      wrote on last edited by
      #2

      A software debounce will not work when the Arduino is sleeping. Because it has to measure the input for a limited period of time, in order to determine whether the input is high or low. Since the arduino is sleeping, it will not be able to use the debounce.

      if the switch, pir sensor or whatever you use to generate an iterrupt causes an instable reading on the pin which will trigger the interrupt, you could use a debouncing circuit. I have seen them on the internet, but you'll need a schmittrigger for that. I haven't tried that myself yet.

      AWIA 1 Reply Last reply
      0
      • stevebusS Offline
        stevebusS Offline
        stevebus
        wrote on last edited by stevebus
        #3

        thanks @TheoL... Makes sense. In this case, I was wiring up a physical pushbutton for it. I can make a electronic debouncer if I need it, but in my limited testing of this, it didn't seem to need it, so I think I'm good for now. thank you for the reply!

        Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

        Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

        1 Reply Last reply
        0
        • TheoLT TheoL

          A software debounce will not work when the Arduino is sleeping. Because it has to measure the input for a limited period of time, in order to determine whether the input is high or low. Since the arduino is sleeping, it will not be able to use the debounce.

          if the switch, pir sensor or whatever you use to generate an iterrupt causes an instable reading on the pin which will trigger the interrupt, you could use a debouncing circuit. I have seen them on the internet, but you'll need a schmittrigger for that. I haven't tried that myself yet.

          AWIA Offline
          AWIA Offline
          AWI
          Hero Member
          wrote on last edited by
          #4

          @TheoL a simple capacitor to ground is sufficient in most cases. If you use the Arduino internal pull-up a you only need a capacitor of around 300 nF to 1 uF.( the "100" value in the schematic) upload-53d39f96-249f-4900-b3b0-8cf81b7e09cc

          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