Do I need the library WProgram.h

This line

  f_TripA = rtc_ReadFloat( TRIPA_ADDR );

is getting this error message

C:\Program Files\Arduino\libraries\TimedAction/TimedAction.h:33:22: error: WProgram.h: No such file or directory
GPSdistance.ino: In function 'void setup()':
GPSdistance:85: error: 'rtc_ReadFloat' was not declared in this scope

This is the TimedAction library, last updated in 2010


#include "WProgram.h"

#define NO_PREDELAY 0

class TimedAction {
    TimedAction(unsigned long interval,void (*function)());
    TimedAction(unsigned long prev,unsigned long interval,void (*function)());

    void reset();
    void disable();
    void enable();
    void check();

    void setInterval( unsigned long interval );

    bool active;
    unsigned long previous;
    unsigned long interval;
    void (*execute)();



|| @changelog
|| | 1.6 2010-10-08 - Alexander Brevig : Changed datatype of interval from unsigned int to unsigned long
|| | 1.5 2009-10-25 - Alexander Brevig : Added setInterval , requested by: Boris Neumann
|| | 1.4 2009-05-06 - Alexander Brevig : Added reset()
|| | 1.3 2009-04-16 - Alexander Brevig : Added disable() and enable(), requested by:;username=ryno
|| | 1.2 2009-04-13 - Alexander Brevig : Added a constructor
|| | 1.1 2009-04-08 - Alexander Brevig : Added an example that demonstrates three arduino examples at once
|| | 1.0 2009-03-23 - Alexander Brevig : Initial Release
|| #

It looks to me like it needs #include "WProgram.h" I don't seem to have it and can't find it anywhere. If so where do I get it, I've searched and can't really seem to find much about it.

Replace WProgram.h with Arduino.h, save it, then restart the arduino software.

This getting this error message

No, it isn't.

You are using an outdated version of the TimedAction library. You can update it by changing WProgram.h to Arduino.h. There may be other changes that you need to make, but start there.

The problem is the Arduino team changed some things in the 1.0 release that breaks 100% of the 3rd party libraries written for prior prior releases.

1.0 was released Nov 11, 2011 Since your code is before that date, it is 100% guaranteed not to work with any 1.x Arduino release.

If you google around you can find various bits of information about the things that have to be changed to make it work on Arduino 1.x

Here is one of the many:

--- bill

Thanks for the replies, those did the trick, at least for that little bit. I'm finding out the hard way about the differences in Arduino. This and other forums have been a great help in getting things sorted out.


it is an very old subject. Is it realy so difficult to explain that wiring.h and Wprogram.h are obsolete libraries that must be replaced with Arduino.h that you can download in the virtualwire.h and virtualwire.cpp files in the correct location! with a text editor and that you have to download Arduino.h and place it in the correct libraries location!

watch the error message to see where the Arduino.h is expected and copy Arduino.h to that location with some luck and error and trial the compile can be a success in the end

I am used to Vbasic that language does not punisch the user with unimportant "errors" like arduino.h is fatal error Arduino.h is very good... but the C comunity seem to see hair-splitting as an advantage