Pages: [1]   Go Down
Author Topic: Arduino Pro Mini + 1.0 RC2 + RF24  (Read 2204 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For my students I'm testing RF24 with Arduino 1.0 RC 2

I am getting strange errors:
SPI/SPI.h

Arduino.h: No such file or directory

Arduino.h is there in hardware/arduino/cores/arduino (inside Arduino app on my Mac).
So any idea on how this issue is happening and so how to solve it?! (Except by putting the Arduino.h file and all other dependent files in libraries...)
it just doesn't seem to be able to find the core files.
Logged

0
Offline Offline
God Member
*****
Karma: 24
Posts: 586
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino 1.0 renamed the header files, which breaks nearly all 3rd party libraries.

Usually replacing any includes of WProgram.h with this solves the problem:

#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 7
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a current build?

RF24.cpp has this:

Code:
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif

Perhaps you could post the entire output from the compiler (hold down shift when you press 'verify').

Also, if you find any probs using RF24, please feel free to open an issue on github.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think this is the easiest way to solve the problem:

To update old cores (such as Sanguino)
Code:
echo "#include \"WProgram.h\"" > hardware/Sanguino/cores/arduino/Arduino.h

To compile old programs on new cores (>=1.0)
Code:
echo "#include \"Arduino.h\"" > hardware/arduino/cores/arduino/WProgram.h
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 7
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

(You've got them backwards by the way).

As a library writer, you cannot expect users to modify their core.  So the library has to solve the Arduino.h/WProgram.h problem itself anyway.
Logged


Pages: [1]   Go Up
Jump to: