Jump to content

Let's make a Controller, and other fun uses for Arduino


Capt. Obvious

Recommended Posts

  • Replies 111
  • Created
  • Last Reply

there should be three in the library folder plus an examples folder

the files are keywords.txt, OneWire.cpp, and OneWire.h you probably extracted the library incorrectly (or not at all) the errors you are receiving are due to all or at least one of these files missing

here is the library:

http://www.pjrc.com/...ies/OneWire.zip

Link to comment
Share on other sites

start a fresh arduino sketch and paste the following:

#include <OneWire.h>
OneWire ds(3);
void setup(void) {
Serial.begin(9600);
discoverOneWireDevices();
}
void discoverOneWireDevices(void) {
byte i;
byte present = 0;
byte data[12];
byte addr[8];
Serial.print("Looking for 1-Wire devices...\n\r");
while(ds.search(addr)) {
Serial.print("\n\rFound \'1-Wire\' device with address:\n\r");
for( i = 0; i < 8; i++) {
Serial.print("0x");
if (addr < 16) {
Serial.print('0');
}
Serial.print(addr, HEX);
if (i < 7) {
Serial.print(", ");
}
}
if ( OneWire::crc8( addr, 7) != addr[7]) {
Serial.print("CRC is not valid!\n");
return;
}
}
Serial.print("\n\r\n\rThat's it.\r\n");
ds.reset_search();
return;
}
void loop(void) {
}
then verify (click the check mark)
Link to comment
Share on other sites

Sounds like he doesn't have an #include iostream or manip? Maybe missing a ; if this is like c++ I haven't programmed one yet but doesn't one code look like its not pulling the correct inclusions?

Link to comment
Share on other sites

  • 1 month later...

here is the rough layout:

I don't think I am doing this right.. I have my temp sensor hooked up to the 3 pin just like your diagram and when I run the one wire address finder I get nothing.. It says "Looking for 1-wires device"...It doesn't seem to be recognizing the sensor. Any ideas?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...