TinyCircuits Forum

General Category => General Discussion => Topic started by: jgavlik on January 21, 2023, 01:57:53 PM

Title: TinyScreen+ Sleep Mode Question
Post by: jgavlik on January 21, 2023, 01:57:53 PM
Can the TinyScreen+ board be woken up by an external accelerometer signal (interrupt, I suppose) instead of one of the push buttons as this link suggests  ... https://tinycircuits.com/blogs/learn/tinyscreen-external-interrupt-sleep-mode?_pos=1&_sid=7de2a5d9b&_ss=r

That is, without any hardware changes...just software.

Thanks,
-john
Title: Re: TinyScreen+ Sleep Mode Question
Post by: lennevia on January 23, 2023, 12:30:50 PM
Hello John,

Depending on how your accelerometer functions, you may be able to detect a pulse on one of its pins and use that to trigger the interrupt.

Here's the documentation on the attachInterrupt function: https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/
And some helpful hints specific to using an accelerometer in this Arduino forum post: https://forum.arduino.cc/t/configuring-interrupt-on-accelerometer-lis331hh/174168/3

Cheers,
Réna
Title: Re: TinyScreen+ Sleep Mode Question
Post by: jgavlik on January 23, 2023, 01:37:39 PM
Réna,

Thanks for your quick reply.

Now to a related question....

Can one get a hold of some sort of RTC (Real Time Clock) interrupt software to 'wake up' the processor. - I'm thinking of once each second.   This solution would suit many applications and peripheral types that only use the I2C bus.

Thanks again,

-john
Title: Re: TinyScreen+ Sleep Mode Question
Post by: lennevia on January 23, 2023, 06:03:26 PM
Is this what you're looking for? https://github.com/arduino-libraries/RTCZero/blob/master/examples/SleepRTCAlarm/SleepRTCAlarm.ino
Title: Re: TinyScreen+ Sleep Mode Question
Post by: jgavlik on January 24, 2023, 01:08:16 PM
Looks like it....let me check it out further...if it, indeed is, consider offering it to all of those of us who would like to reduce the power consumption of this processor.

Thanks again....
-john
Title: Re: TinyScreen+ Sleep Mode Question
Post by: alijen on June 13, 2023, 12:52:18 AM
This solution would suit many applications and peripheral types that only use the I2C bus.