Pages: [1]   Go Down
Author Topic: DallasTemperature does not name a type error  (Read 1034 times)
0 Members and 1 Guest are viewing this topic.
New Jersey
Offline Offline
God Member
*****
Karma: 2
Posts: 517
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the Xcode IDE with my Arduino.  I don't have a problem compiling sketches that use onewire protocal in the Arduino IDE, but in Xcode, I'm getting this error:
DallasTemperature does not name a type
Below is a simple sketch that causes the error and I attached the libraries.  I can't figure out why Xcode gives me this error.  Can anyone help.

Code:
#include "Arduino.h"
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire(2);
DallasTemperature waterTempSensors(&oneWire);  // Get error here
void setup() {}
void loop() {}

* DallasTemperature.cpp (21.01 KB - downloaded 33 times.)
* DallasTemperature.h (6.64 KB - downloaded 25 times.)
* OneWire.cpp (15.98 KB - downloaded 38 times.)
* OneWire.h (6.9 KB - downloaded 20 times.)
Logged

New Jersey
Offline Offline
God Member
*****
Karma: 2
Posts: 517
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found the problem.  My library folder name needs to match the library name.  I had my library like this:
\Arduino\libraries\OneWireDallasTemp\DallasTemperature.h
\Arduino\libraries\OneWireDallasTemp\DallasTemperature.cpp

I renamed the folder \OneWireDallasTemp\ to \DallasTemperature\ and now it compiles.  I guess the Arduino IDE doesn't care about the directory name but Xcode does.

Logged

Pages: [1]   Go Up
Jump to: