Creating a library

Hi,

I'm trying to create a new library.

I'm using the tutorial available on this page:

The problem is that when I use my library in a program, it complains that the WProgram.h file doesn't exist !
Is it an old tutorial or am I doing something wrong ?

Thanks.

Pollop.

The problem is that when I use my library in a program, it complains that the WProgram.h file doesn't exist !

The tutorial has not been updated for 1.0, yet. I'm sure you can search and find the solution. It's only been posted about 42 bazillion times this year.

Wow, what a helpfull response. That is a sure way to encourage new users.......

pollop, your problem discription indicates that you are using the 1.0 Arduino with code written for the Arduino-0022. "WProgram.h" was replaced by "Arduino.h"
finf the include for Wprogram.h and replace it with Arduino.h, or the following:
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

Good luck and have fun learning. Once you learn what you are doing (and you never, truely will...), be kind to the new guys.

Thanks for your help !
I searched for "creating library" and "make library" before posting but didn't find any answers.
But I should have search a little bit more...

Anyway, I thought well that the tutorial is outdated :slight_smile:

Thanks again for your help, I'm just gonna include the Arduino.h instead.

Pollop.

(It's really great to get help when you begin playing with Arduino, really appreciated!)

PaulS:

The problem is that when I use my library in a program, it complains that the WProgram.h file doesn’t exist !

The tutorial has not been updated for 1.0, yet. I’m sure you can search and find the solution. It’s only been posted about 42 bazillion times this year.

PaulS I understand your frustration for that recurring question, but I can assure you that finding that damn piece of preprocessor code is not as easy as it should be, even when one knows what he’s searching for.

It’s about time that the library tutorial is updated, if we (?) want these questions to stop popping up.