How to generate SAMD21 wake-up interrupts with analog input

Hi everyone,

I am working on a LoRaWAN project (human presence detection with smart seats) where, as you can see, I am using the SAMD21 PRO RF and an FSR 406 sensor. The device will be powered by a 2Ah LiPo battery.

In order to minimize power consumption, I want to program the device in such a way that it will remain in sleep mode while no force is applied to the FSR. Also, once force is applied to the FSR, the device should periodically (e.g. every 5 minutes) take measurements and broadcast the data to The Things Network via The Things Indoor Gateway until no force is detected (where the device will enter the sleep mode again). As FSR provides the microcontroller with analog input the only solution I found is to use Analog Comparator (AC) to generate wake-up interrupts. Here is where I need some guidance! Is this something that can be done on the SAMD21? If yes, which are the necessary libraries I have to use, and are there any code examples that can help me?

How manage to do it? If my understanding is right, you just wanna place an interruption somewhere to wake your board. (Please correct me if this isn`t what you wanted to say)

I use the Adafruit sleepy dog to make the board sleep and just a simple Arduino interruption wake it up. I did`t need to add anything else.

attachInterrupt(digitalPinToInterrupt(interruptPin), blink, RISING);

With this, my thingsplus wakes from the sleep, execute the blink function and than go through the normal routine after waking up.