Go Down

Topic: Arduino and 1-wire (Read 17 times) previous topic - next topic


When attempting to compile my program with the onewire library I am getting this error. I have created the library directories and added the keyword file.

o: In function `__static_initialization_and_destruction_0(int, int)':
undefined reference to `OneWire::OneWire(unsigned char)

Anyone know how to fix it?

#include <OneWire.h>

OneWire  ds(10);  <------------ Commenting out this line makes the program compile

void setup() {



But does you program work without "OneWire ds(10)"? I don't think so.


Thank you for the lovely OneWire library, it works well!

The only problem I had with it is that it really eats up SRAM. The CRC tables use about 256 bytes of RAM (from the 1 kbytes the atmega168 has).
On my system I have temporarily commented out that section, but I think a good solution would be to use PROGMEM for the CRC tables. (Some links about PROGMEM:
http://www.arduino.cc/en/Reference/PROGMEM )


Has anyone tried the library with the arduino-0010 version yet?   When I try to use the 008 version of the OneWire library with it, I get a bunch of errors.  


Jan 18, 2008, 02:44 am Last Edit: Jan 18, 2008, 02:44 am by DanMo Reason: 1
I put the files in hardware/libraries/OneWire and everything worked fine.  I am on OS X using arduino-0010 and the 0008 version of the OneWire library.


PS - Can the OP post the circuit they are testing with?

Go Up