- You must be logged in to reply to this topic.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
Hello all,
I’m probably making a mountain out of a mole hill but I’m at wits end so I thought I’d reach out for some assistance. I’m using a 32u4 Feather with LORA for use as a remote motion detection alarm. I’ve been able to incorporate the low power library along with a DS3231 real time clock and can successfully wake by either either elapsed time (to send current battery voltage and alarm is still in operation) or interrupt on motion (alarm triggered) but not both in the same code. I could punk out and just send the voltage anytime an alarm as tripped but the routine check in is a great “reassurance” feature to have.
I dug up a long ago question/response (2013) where someone asked about a similar setup and the response by Administrator was
“You can do that. By pushing it to power down mode with the sleep interval you desire. At the same time, attach the external interrupt.
In this case, your board could wake up on either of the source. To check the wake up source, use a semaphore flag in your external interrupt handler function and check it upon waking up.”
—
For the life of me, I can’t figure out what would seem to be the “simple” use a semaphore flag in your external interrupt handler function and check it upon waking up. Could someone please save my sanity by providing a simple bare bones example? Many thanks in advance for your time and consideration!!!
Hi SteveD,
Here’s a skeleton code for your application:
volatile bool pirTrip = false;
loop()
{
.....
attachInterrupt(0, pirTripEvent, LOW);
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
if (pirTrip)
{
pirTrip = false;
// Send data, etc
}
}
void pirTripEvent(void)
{
pirTrip = true;
}
This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.
OKWe may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.
Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.
These cookies are strictly necessary to provide you with services available through our website and to use some of its features.
Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.
We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.
We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.
These cookies collect information that is used either in aggregate form to help us understand how our website is being used or how effective our marketing campaigns are, or to help us customize our website and application for you in order to enhance your experience.
If you do not want that we track your visit to our site you can disable tracking in your browser here:
We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.
Google Webfont Settings:
Google Map Settings:
Google reCaptcha Settings:
Vimeo and Youtube video embeds:
The following cookies are also needed - You can choose if you want to allow them:
You can read about our cookies and privacy settings in detail on our Privacy Policy Page.
Privacy Policy