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. Multiple buttons, one interrupt

Multiple buttons, one interrupt

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 2.5k 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.
  • K Offline
    K Offline
    kolaf
    Hero Member
    wrote on last edited by
    #1

    I have a battery-powered sensor that I want to sleep as much as possible. The trouble is that I have two door sensors that I want to keep track of using interrupts, but only one interrupt pin available (interrupt 0 is used by the radio on my moteino, I think). Is it possible to use the pinChangeInt library to have the sensor wake from gw.sleep() in some way, or is this only possible using the hardware interrupt pins? Is there any other way I can wake on one or more buttons/reed switches using only one interrupt?

    Thanks.

    SparkmanS 1 Reply Last reply
    0
    • K kolaf

      I have a battery-powered sensor that I want to sleep as much as possible. The trouble is that I have two door sensors that I want to keep track of using interrupts, but only one interrupt pin available (interrupt 0 is used by the radio on my moteino, I think). Is it possible to use the pinChangeInt library to have the sensor wake from gw.sleep() in some way, or is this only possible using the hardware interrupt pins? Is there any other way I can wake on one or more buttons/reed switches using only one interrupt?

      Thanks.

      SparkmanS Offline
      SparkmanS Offline
      Sparkman
      Hero Member
      wrote on last edited by
      #2

      @kolaf Here's a way to accomplish that: http://www.gammon.com.au/forum/?id=11091.

      Cheers

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kolaf
        Hero Member
        wrote on last edited by kolaf
        #3

        @Sparkman Many thanks, but using "or" doesn't allow me to detect if the second switch is pulled low after the first switch is pulled low, since the interrupt will already be low. I was thinking that maybe some kind of XOR function would work since it would change the output whenever any input changes. However, I'm not exactly sure how to implement this, especially not for more than two switches (if the XOR function is even defined for more than two inputs). Also, my arsenal is currently pretty limited, I only have resistors (although I suspect I will have to change this at some point, but not in the middle of Easter).

        SparkmanS 1 Reply Last reply
        0
        • K kolaf

          @Sparkman Many thanks, but using "or" doesn't allow me to detect if the second switch is pulled low after the first switch is pulled low, since the interrupt will already be low. I was thinking that maybe some kind of XOR function would work since it would change the output whenever any input changes. However, I'm not exactly sure how to implement this, especially not for more than two switches (if the XOR function is even defined for more than two inputs). Also, my arsenal is currently pretty limited, I only have resistors (although I suspect I will have to change this at some point, but not in the middle of Easter).

          SparkmanS Offline
          SparkmanS Offline
          Sparkman
          Hero Member
          wrote on last edited by
          #4

          @kolaf Also, Google pinchageint which is a library that I believe allows for more interrupts..

          Cheers

          Al

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


          18

          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