After a new motherboard and subsequent upgrade to OSX Lion, I was asked to upgrade to Arduino 1.0, so I did thinking in for a penny. I had to replace all the libraries, after I found out how to do it again online...
The RTC and SD libraries seem to be working but the DHT sensor library returns this when I verify
/Applications/Arduino.app/Contents/Resources/Java/libraries/DHT/DHT.h:2:22: error: WProgram.h: No such file or directory
even if it is the only thing in the sketch
I know I'm a newbie but this seem a little more than I expected
Any thoughts
Thanx in advance
Darren
Upgrade problems
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 295
- Joined: Sat Dec 11, 2010 1:17 am
Re: Upgrade problems
Hi Darren,
If you go into your libraries folder, locate the DHT folder then open dht.h in a text editor. Right at the top there's a line that reads
#include "WProgram.h"
Replace that line with these lines:
If you have Arduino open, close it then re-open it. That should solve your problem.
Cheers!
If you go into your libraries folder, locate the DHT folder then open dht.h in a text editor. Right at the top there's a line that reads
#include "WProgram.h"
Replace that line with these lines:
Code: Select all
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
Cheers!
-
- Posts: 24
- Joined: Thu Aug 11, 2011 9:47 pm
Re: Upgrade problems
Hey Stephanie:
Thanx so much for that, it worked and now I find the same issue comes up with the RTC
/Applications/Arduino.app/Contents/Resources/Java/libraries/adafruitRTClib72fc1a4/RTClib.cpp:7:22: error: WProgram.h: No such file or directory
I thought I'd be smart and try to add the same patch of lines in...
Sadly I am not smart, it returned the same error. What exactly is the WProgram.h? I see it in the RTC.cpp but I feel a bit like I'm trying to understand the my own brain by cutting away bits of it and seeing what I can't do any more.
Thanx so much for that, it worked and now I find the same issue comes up with the RTC
/Applications/Arduino.app/Contents/Resources/Java/libraries/adafruitRTClib72fc1a4/RTClib.cpp:7:22: error: WProgram.h: No such file or directory
I thought I'd be smart and try to add the same patch of lines in...
Sadly I am not smart, it returned the same error. What exactly is the WProgram.h? I see it in the RTC.cpp but I feel a bit like I'm trying to understand the my own brain by cutting away bits of it and seeing what I can't do any more.
-
- Posts: 295
- Joined: Sat Dec 11, 2010 1:17 am
Re: Upgrade problems
WProgram.h was a 'header' file that was used with the older Arduino libraries. With the switch to version 1.0 of the IDE they have basically renamed this header to Arduino.h - the problem being that it essentially broke every 3rd-party library out there.
There are some additional changes that were made which further broke a bunch of libraries, such as some changes to the Wire library. Wire is used for I2C and this is used by the real time clock. They changed the names of two functions, so every library that used Wire needed to be changed to work with the new terminology.
You should be able to just download the latest version of the RTC library from github:
https://github.com/adafruit/RTClib
That should compile fine under Arduino 1.0. Simply delete the RTC library in your libraries folder, then unzip the new one and follow the directions in its readme file.
Actually I think the DHT library has similarily been updated. You don't need to re-download it now that you've got it working, but it never hurts to have the latest version just incase there were other changes:
https://github.com/adafruit/DHT-sensor-library
Cheers!
There are some additional changes that were made which further broke a bunch of libraries, such as some changes to the Wire library. Wire is used for I2C and this is used by the real time clock. They changed the names of two functions, so every library that used Wire needed to be changed to work with the new terminology.
You should be able to just download the latest version of the RTC library from github:
https://github.com/adafruit/RTClib
That should compile fine under Arduino 1.0. Simply delete the RTC library in your libraries folder, then unzip the new one and follow the directions in its readme file.
Actually I think the DHT library has similarily been updated. You don't need to re-download it now that you've got it working, but it never hurts to have the latest version just incase there were other changes:
https://github.com/adafruit/DHT-sensor-library
Cheers!
Please be positive and constructive with your questions and comments.