// Data wire is plugged into port 2 on the Arduino #define ONE_WIRE_BUS 53
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
Serial.print("Temperature for Device 1 is: ");
Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
In what folder did you place the One Wire folder? I do not see a hardware/libraries directory in my Arduino folder. I see hardware and libraries as two separate folders.
UPDATE: I placed the OneWire folder into arduino-0018\libraries. Then you MUST close aruduino, restart it, then compile. When adding new files to the library you must restart arduino so it can adjust to changes. This eliminates wasting time and software debugging thats not particularity necessary
After putting the libraries in the proper places and restarting Arduino, load your sketch (without the #includes).
Then go to the Sketch->Import Library menu item and select the library from the list. If the library does not appear in the list, it's in the wrong place in the directory tree. If it can find it, Arduino will helpfully insert the #include statement at the top of your sketch.
There are three types of .extention , .c .cpp and .h
For .h use " double quotes " not
Try this with your file path extentions and it should work, but then try again with file name only to verify you have library in libraryand prog in core and they are all standard. If you pasted a code with <OneWire.h> from someones code...it would appear they posted a non compile tested version.