I am a bit new here and have managed to get a few things working but I always struggle finding libraries to download and use.
I am trying to find the sleep library at the moment.
Any pointers?
And is there an easy way to find libraries?
Thanks
I am a bit new here and have managed to get a few things working but I always struggle finding libraries to download and use.
I am trying to find the sleep library at the moment.
Any pointers?
And is there an easy way to find libraries?
Thanks
Are you thinking delay() maybe?
no the power save library
AVR Sleep
kpg:
And is there an easy way to find libraries?Thanks
Heard of Google, its a very usefull Internet search engine ?
For instance try a Google search on;
'Arduino Sleep Library'
kpg:
I am trying to find the sleep library at the moment.
kpg:
no the power save libraryAVR Sleep
Why are you being so vague? It's almost as though you don't want a solution to your question. There are many sleep libraries. Presumably there is some context to this "sleep library"/"power save library"/"AVR Sleep" thing you're looking for. Maybe you read about it somewhere? Maybe you found some code that uses this library? Surely there is more information than what you've trickled to us.
Not trying to be vague just don't have much knowledge yet.
My sketch needs...
#include <avr/sleep.h>//this AVR library contains the methods that controls the sleep modes
If I google it I get lots of threads but I cant see a library file (yet).
The question was also a more general one about finding libraries as well. Is there one or a few good sites to download libraries?
The library that ships with avr-gcc is installed with the IDE and should be accessible by;
#include <avr/sleep.h>
which would give you some indication as to where to find it on your hard drive;
C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr
Aha! Now we have the information we need. avr/sleep.h is part of avr-libc:
https://www.nongnu.org/avr-libc/user-manual/group__avr__sleep.html
This is part of the AVR toolchain so it's not the same as the standard Arduino libraries you install. It comes as an integral part of the Arduino AVR Boards hardware package.
kpg:
The question was also a more general one about finding libraries as well. Is there one or a few good sites to download libraries?
The best place is in the Arduino IDE's Library Manager: Sketch > Include Library > Manage Libraries. Library Manager allows you to search, install, and update 1789 libraries, and more are added every week!
You can also access the list of Library Manager libraries online with a different search interface here:
Due to the library author needing to request inclusion, Library Manager does not contain every 3rd Arduino Library.
Google is going to be the way to find all of them, but you may need to sift through some garbage. I often will add site:github.com to my Google searches for libraries since the majority of Arduino libraries are hosted on GitHub.
GitHub has an "arduino-library" topic that can be a good way to discover libraries:
Since the library author must add the arduino-library topic to their repositories and that is a relatively new feature of GitHub, there are many Arduino libraries on GitHub that don't have the arduino-library topic. I wrote a script that automatically scans GitHub and generates a list of every Arduino library it finds. There are 8848 libraries on the list:
There is a list of Arduino libraries in the Arduino Playground:
https://playground.arduino.cc/Main/LibraryList
Thankyou so much.
very helpful.
Got it now.