Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: Interrupt

Home Forums Mayfly Data Logger Interrupt Reply To: Interrupt

#2280
Sara Damiano
Moderator

    You should also be able to use pin-change interrupts for the tipping bucket, which would allow you to use any pin at all. Using pin change interrupts requires an extra library, though. I’m a fan of GreyGnome’s EnableInterrupt library, which I’ve modified to have all the right pin numbers for the Mayfly: https://github.com/EnviroDIY/EnableInterrupt

    The external interrupts do have priority over pin-change interrupts, but I don’t imagine the bucket would tip so fast that you’d have any problems, especially when your ISR is just a count.

    All pin change interrupt libraries also conflict with the interrupts defined by SoftwareSerial and the SDI-12 library, although there are fairly easy work-arounds for those if you need them.