Struggling with Trinket M0 and avr/sleep.h

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
GaryMiyakawa
 
Posts: 11
Joined: Mon Jan 17, 2022 12:39 pm

Struggling with Trinket M0 and avr/sleep.h

Post by GaryMiyakawa »

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

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

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

Post by mikeysklar »

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

https://github.com/adafruit/Adafruit_SleepyDog

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

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

Post by GaryMiyakawa »

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

Gary M

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”