-->
Page 1 of 1

Making my first library

PostPosted: Tue May 26, 2015 8:51 pm
by Stevenelson
I'm making my first arduino library and I'm a little stumped maybe one of you could kindly point me in the right direction.

So I've made a series of functions that make using EEProm MUCH easier. The functions work fine in a regular arduino sketch, but once I move them into .h and .cpp files it doesn't want to include the eeprom.h base library.

Here's my eePromString.h file:

Code: Select all#ifndef EEPROMSTRING_H
#define EEPROMSTRING_H

#include "Arduino.h"
#include <EEPROM.h>

class eePromString
{
   public:
      eePromString(int length);
      void set(String name, String newvalue);
      void clear();
      String get(String name);
      String list();
      String Delete(String name);
   private:
      
};

#endif

But, I'm getting this error:

No such file or directory #include <EEPROM.h>

I have also tried including it in the .cpp file, I get the same error. It seems like it's looking for the file in the relative folder and not finding it. Do i have to include it with an absolute path or something?

Any suggestions would be very helpful!

Re: Making my first library

PostPosted: Wed May 27, 2015 12:18 am
by reaper7
do You have:
Code: Select all#include <EEPROM.h>
inside main ino file too?

Re: Making my first library

PostPosted: Thu May 28, 2015 1:14 am
by burkmurray
Check your folder structure and case - the IDE is aggravatingly picky about where it expects to find files.

Your .h file needs to be in a folder/dir in your libraries directory, like this:

Libraries\EEPROM\EEPROM.h

And your #include is case sensitive: "#include EEPROM.h" will fail (with the error you quoted) if your file is named "eeProm.h".

Don't forget that the IDE won't recognize your library until you quit and restart.

Good luck, and congrats on your first library!