Snooze on Teensy 3.2

Teenfor3

Well-known member
I have been trying the examples in Teensy library for Snooze deepSleep and hibernate. I get both to work as I think OK.
Before I started Teensy was taking about 45 mA when running small sketch eg blink and other examples, not much difference no matter what small sketch.
When I loaded and run Snooze.deepSleep Teensy still took about 45 mA and during sleep dropped to about 0.7 mA. I then run Snooze.hibernate and it seemed to run OK as well but the power taken was about 26 mA normal dropping to about 0.3 mA on hibernate. Went back loaded Snooze.deepSleep and it now takes 26 mA normal dropping to 0.3 mA on deepSleep. Also now loading blink or any small example sketch all take about 26 mA dropping to 0.3 on deepsleep or hibernate. All other function. of the teensy seem to be working and the 5 volts is at supply pins and 3.3 volt at the the 3.3 v pin. Googling for some info I came across that hibernate switches USB to low power state ?? does that mean something may have switched and I need a command or line of code to take it back out of hibernation. ??
 
" I don't believe it" ..... I have just noticed that when compiling and uploading the CPU Speed was at 48 MHz .... I normally keep this at 96 MHz overclocked. So set it back to 96 and teensy now takes about 40 mA running and drops to about 0.6 mA on deepSleep as it had been doing originally also hibernate behaves the same ....does not seem to matter which I use.....so which snooze is best recomended generally for a user to switch to an idle state (battery saving) when user is using device intermittently and wants to keep his user settings the same each use. When he is finished a session he then switches off completely which will loose his settings but then he just sets it up probably differently for next session.
Is there a way to call a function that will put the teensy into snooze ..... I see the examples use the value "who" returned from Snooze.deepSleep. I just use the bit of code below but I have no way of calling it and say making it "beep" to let me know system is in szooze.
So since I am using the Snooze Touch option I touch pin(0) make it run the "beep()" and then run Snooze.deepSleep which seems to put it into snooze ...OK.

Code:
 if (touchRead(0) >= 800) {
                 beep();
                   Snooze.hibernate( config_teensy32 );  // go snooze hibernate
                //   Snooze.deepSleep( config_teensy32 );  // go snooze deepSleep
                    }


Pin(18) is defined as the touch wakeup pin ?????

Code:
touch.pinMode(18, touchRead(18) + 250); // touchpin for wakeup, threshold value

Then to get out of Snooze I touch pin(18) .......I get beep (line below) to let me know I have made contact with pin and touching this pin puts teensy in wakeup mode and running.

Code:
if (touchRead(18) >= 800) beep();

Is there any better way to call these functions....????
 
Back
Top