If you are using libraries such as Wire in your own .c files or library then you need to #include <LibraryName.h> both in your library (where you're using the things it defines) and in your main sketch (which tells the IDE to include its folder in the search path for includes during compilation and to link […]
Category: Libraries
Adding A Library
Adding A Library Using the IDE Library Manager Open the Arduino library manager: Menu > Sketch > Include Library > Manage Libraries Adding A Library For All Projects On Windows Copy the library directory into the folder: My Documents /Arduino/libraries/ On A Mac Copy the library directory into the folder: ~/Documents/Arduino/libraries/ Restart the Arduino IDE and the library […]
Creating A Library
Library Files A library contains a .h header file and a .c or .cpp source code file as a minimum. Additional files can be added as needed. The files should used inside a directory typically given the library name. Create a .h File #ifndef MY_LIBRARY_H //Do only once the first time this file is used #define MY_LIBRARY_H […]