TinyCircuits

TinyScreen+ interrupts and sleeping.

TinyScreen+ interrupts and sleeping.
« on: November 10, 2019, 11:46:54 PM »
Is there any working example code for putting the TinyScreen+ device to sleep and waking it up on button press?

The existing example code for the watch project doesn't seem to work (I think it is not up to date for the latest board revisions). I had to delete all the Bluetooth references since I am not adding a Bluetooth shield. With a few minor changes the program then works fine as long as I have it avoid going to sleep.

Re: TinyScreen+ interrupts and sleeping.
« Reply #1 on: November 11, 2019, 03:15:51 PM »
If I look at the schematic [1], it seems that the buttons are connected to pins 37, 38, 47, 48.
However, TinyScreen.h has the pin numbers as 19, 25, 30, 31 [2].
I am wondering if the TinyScreen library is outdated or if that is written for the shield instead of the +?

[1] https://github.com/TinyCircuits/TinyCircuits-TinyScreenPlus-ASM2022/raw/master/design_files/ASM2022_Rev4.pdf
[2] https://github.com/TinyCircuits/TinyCircuits-TinyScreen_Lib/blob/master/TinyScreen.h#L88
« Last Edit: November 11, 2019, 06:05:24 PM by gregweber »

Re: TinyScreen+ interrupts and sleeping.
« Reply #2 on: November 20, 2019, 11:33:36 AM »
Hello,

After some review, it does seem that there might be an issue with the example. We will be looking into this!

In the meantime, there is a simple example attached to this reply for using external interrupts to wake the processor from sleep mode.

Best of luck,

Réna

Re: TinyScreen+ interrupts and sleeping.
« Reply #3 on: November 25, 2019, 07:58:57 AM »
Thanks, that code example is super helpful! It seems to work.

Can you put the code on github? That way it is easy to stay up to date with changes and the community can help maintain the examples.. You can still post a download link here from github if you want to do that.

Re: TinyScreen+ interrupts and sleeping.
« Reply #4 on: November 26, 2019, 10:04:32 AM »
I made some minor changes and put it on github here: https://github.com/gregwebs/tinyscreen-interrupt