Sleep include files

I have been trying several "sleep" include files to reduce the power consumption of instrumentation.

Sleep_n0m1 (from GitHub) would do what I want but I get the error message: "Arduino\libraries\sleep.h :30:23 fatal error: AVR/sleep.h: no such file exists". A look at the code confirms that Sleep_nom1 includes "sleep.h".

I have also tried Narcoleptic.h (from Google code archives) with a similar error: fatal error" AVR/io.h: no such file exists". Again, the .cpp files incudes a call to io.h

Do these reference discontinued code? Does anyone have a "work a round" or other suggested solution.

Thank you for any possible suggestions.

(deleted)

rickir206:
I have been trying several "sleep" include files to reduce the power consumption of instrumentation.

Sleep_n0m1 (from GitHub) would do what I want but I get the error message: "Arduino\libraries\sleep.h :30:23 fatal error: AVR/sleep.h: no such file exists". A look at the code confirms that Sleep_nom1 includes "sleep.h".

I have also tried Narcoleptic.h (from Google code archives) with a similar error: fatal error" AVR/io.h: no such file exists". Again, the .cpp files incudes a call to io.h

Do these reference discontinued code? Does anyone have a "work a round" or other suggested solution.

Thank you for any possible suggestions.

rickir206:
I have been trying several "sleep" include files to reduce the power consumption of instrumentation.

Sleep_n0m1 (from GitHub) would do what I want but I get the error message: "Arduino\libraries\sleep.h :30:23 fatal error: AVR/sleep.h: no such file exists". A look at the code confirms that Sleep_nom1 includes "sleep.h".

I have also tried Narcoleptic.h (from Google code archives) with a similar error: fatal error" AVR/io.h: no such file exists". Again, the .cpp files incudes a call to io.h

Do these reference discontinued code? Does anyone have a "work a round" or other suggested solution.

Thank you for any possible suggestions.

With no code posted, no board type posted, it is hard to offer advice. I use the sleep lib in many projects.

the #include should look like this

#include <avr/sleep.h>
If your code does not have the include like this, please add it. If it does, we need to see your program as well as know what type of device you are using. Also, what version of the IDE are you using.

On windows, you should see the sleep.h here C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr

For the AVR architecture (Uno etc.) this is the definitive guide to power saving including sleep modes etc.:

My thanks to Romonaga for his/her help. I would have thought #include<avr/sleep.h> would have been included in the code for "sleep_0n1m.h" , it would save a lot of questions. BTW, the board I was using was a weMOS di mini pro. I got the same error after including avr/sleep.h, so I assume the weMOS board does not support "sleep_0n1m" as claimed on GitHub. After I changed to an Arduino board, everything works. Thanks again. rickir206

rickir206:
My thanks to Romonaga for his/her help. I would have thought #include<avr/sleep.h> would have been included in the code for "sleep_0n1m.h" , it would save a lot of questions. BTW, the board I was using was a weMOS di mini pro. I got the same error after including avr/sleep.h, so I assume the weMOS board does not support "sleep_0n1m" as claimed on GitHub. After I changed to an Arduino board, everything works. Thanks again. rickir206

Glad I was able to help.

rickir206:
I assume the weMOS board does not support "sleep_0n1m" as claimed on GitHub.

Do you mean Sleep_n0m1? Where do you see this claim? Please post a link to it.

rickir206:
I would have thought #include<avr/sleep.h> would have been included in the code for "sleep_0n1m.h"

It is, right here:

The problem isn't that the library is missing an #include directive, the problem is that the file referenced by that #include directive is not accessible. As you might guess from the folder name, this file is specific to the AVR architecture of the classic Arduino boards like the Uno, Mega, Leonardo, etc. The library was specifically written for AVR. But you are trying to compile if for a microcontroller of a completely different architecture, the ESP8266. Sleep works very differently on the ESP8266 (far inferior to the AVR).