Upgrade problems

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Upgrade problems

Postby SquidTeeth » Wed May 09, 2012 3:31 pm

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
SquidTeeth
 
Posts: 13
Joined: Thu Aug 11, 2011 8:47 pm

Re: Upgrade problems

Postby Stephanie » Wed May 09, 2012 4:41 pm

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:
Code: Select all
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif


If you have Arduino open, close it then re-open it. That should solve your problem.

Cheers!
User avatar
Stephanie
 
Posts: 286
Joined: Sat Dec 11, 2010 12:17 am
Location: Canada

Re: Upgrade problems

Postby SquidTeeth » Wed May 09, 2012 6:09 pm

Hey Stephanie:
Thanx so much for that, it worked and now I find the same issue comes up with the RTC :roll:

/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.
SquidTeeth
 
Posts: 13
Joined: Thu Aug 11, 2011 8:47 pm

Re: Upgrade problems

Postby Stephanie » Wed May 09, 2012 6:56 pm

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!
User avatar
Stephanie
 
Posts: 286
Joined: Sat Dec 11, 2010 12:17 am
Location: Canada


Return to Arduino

Who is online

Users browsing this forum: Google [Bot] and 10 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [108]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[34]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]