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. Arduino Mega 2560 Can we use more interrupts than 2?

Arduino Mega 2560 Can we use more interrupts than 2?

Scheduled Pinned Locked Moved Development
3 Posts 3 Posters 2.3k 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.
  • macieiksM Offline
    macieiksM Offline
    macieiks
    wrote on last edited by
    #1

    Hi Guys,

    I would like to implement Node that will be responsible for detecting LPG/CO/Smoke/Leak/Fire. As far as I know MySensor function "gw.sleep()" can deliver hardware interrupt just for two pins (standard). My question is: Can we use function that could handle more than 2 interrupts ? I would like to use my spare Arduino Mega 2560 (it has the ability to use 6x hardware based interrupts).

    Looking forward for your reply
    Thx Maciek

    RPI2 + RFLink + PiFace D2 + Aeon Z-Wave Gen5 + Foscams FI9821P&R2 + MySensors + UPS APC Back-UPS 950VA
    RPI2 + RFXtrx433e + Foscams FI9821P + MySensors + UPS APC Back-UPS 950VA
    RPIB+ + TP-Link MR3420 + Huawei E173 GarageDomoticz :)

    DwaltD 1 Reply Last reply
    0
    • macieiksM macieiks

      Hi Guys,

      I would like to implement Node that will be responsible for detecting LPG/CO/Smoke/Leak/Fire. As far as I know MySensor function "gw.sleep()" can deliver hardware interrupt just for two pins (standard). My question is: Can we use function that could handle more than 2 interrupts ? I would like to use my spare Arduino Mega 2560 (it has the ability to use 6x hardware based interrupts).

      Looking forward for your reply
      Thx Maciek

      DwaltD Offline
      DwaltD Offline
      Dwalt
      wrote on last edited by
      #2

      @macieiks I think the number of interrupts is dictated by the particular board (chip), not the MySensors library. Using gw(sleep) may not be applicable for your project. It is meant for low power applications and your list of sensors, in particular the gas sensors, may not be suitable for battery power. A mega with mains power would certainly work.

      Veralite UI5 :: IBoard Ethernet GW :: MyS 1.5

      1 Reply Last reply
      0
      • R Offline
        R Offline
        riataman
        wrote on last edited by riataman
        #3

        You can have CHANGE interrupts in any pins in the atmega328. See http://playground.arduino.cc/Main/PinChangeInterrupt

        I haven't actually tested it, but it's in my list of things to try, as I want to have door/window sensors that monitor 4+ doors.

        Edit: I went ahead and tested, it worked just copy and pasting the code from that page. The interrupt will wake up a atmega328p. You just will need to figure out what pin actually changed by remembering state.

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


        12

        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