Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Struggling with Trinket M0 and avr/sleep.h
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Struggling with Trinket M0 and avr/sleep.h

by GaryMiyakawa on Thu Jan 20, 2022 10:40 pm

I'm working on a sketch that will blink an LED every 4 seconds so I would like to put the Trinket M0 to sleep in between to save battery.

Where I'm having trouble is with the Include avr/sleep.h.....

I'm using 1.8.19 IDE (and tried 2.0) but in all cases, I get "File not found" and if I comment out the include, the variables that are defined in sleep.h are not found.

I've spent all day trying to resolve this and I'm sure it's something stupid I'm missing...

Any help out there ?

Thank you,

Gary Miyakawa

GaryMiyakawa
 
Posts: 11
Joined: Mon Jan 17, 2022 12:39 pm

Re: Struggling with Trinket M0 and avr/sleep.h

by mikeysklar on Fri Jan 21, 2022 9:13 pm

The Trinket M0 would need to use a modern SAMD library for sleep. Take a look at SleepyDog.

https://github.com/adafruit/Adafruit_SleepyDog

mikeysklar
 
Posts: 7513
Joined: Mon Aug 01, 2016 8:10 pm

Re: Struggling with Trinket M0 and avr/sleep.h

by GaryMiyakawa on Sat Jan 22, 2022 3:52 pm

Thank you for the suggestion. I'll give it a try!

Gary M

GaryMiyakawa
 
Posts: 11
Joined: Mon Jan 17, 2022 12:39 pm

Please be positive and constructive with your questions and comments.