Hello, I have been able to answer my question myself. There is a sample code of "snooze.h", but I had not understood it. If someone has the same problem as me, here is a short explanation and a small sample code.
Code:
#include <Snooze.h>
SnoozeDigital digital;
SnoozeBlock config(digital);
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digital.pinMode(21, INPUT_PULLUP, RISING);//Pin 21 is used as interupt pin to wake up the teensy from sleeping
}
void loop() {
int who = Snooze.deepSleep( config );// this codeline puts the teensy into sleep-mode now
// Teensy sleeps until it get waked up with Pin21
// When it get waked up, this function gives back the number of "waking-up-reason" to "who"
for(int i=0; i<who; i=i+1) //blinks 21 times if controller was waked up by Pin 21
{
digitalWrite(LED_BUILTIN, HIGH);
delay(200);
digitalWrite(LED_BUILTIN, LOW);
delay(200);
}
}