Dallas DS18B20 Temp sensor compiling error?

Hi all,

I'm having a problem getting a Dallas DS18B20 to work with my Uno and IDE 1.05 r2. I've installed the Dallas Temperature and OneWire libraries, but when I try to load any sketch from the examples file (or the One Wire address finder Sketch) I get the following error message:

Error compiling

error: 'delayMicroseconds' was not declared in this scope

The wiring uses a 4k7 pull up resistor between DQ and +5v, as this is what most examples recommend.

I'm sure I've just made a silly mistake, so a nudge in the right direction would be much appreciated!

Thanks in advance,

Mark

Do you have links to the libraries you have installed? I suspect the libraries are written for pre 1.0 arduino IDE

All my info and libraries has come via this website:

http://www.hobbytronics.co.uk/ds18b20-arduino

MarkiT:
I'm sure I've just made a silly mistake,

Quite probably, and easily fixed.

Try here

I don't think the library is the problem but those from here work with IDE v1.6, and the code is the best I know.

Ok, thanks for the link. I'll give it a go later and let you know how I get on.

Thanks for the 'nudge'!

Mark

I like HobbyTronics, have bought stuff from them a few times. If you look on the page you linked to they say the version they used (and link to from there site) is 3.6.0 but if you go to the milesburton site they also link to you will see...

Code/Library
Latest

TCL 3.7.2 (works with Arduino 1.0)

so the 3.6.0 is not compatible with >= 1.0 IDE.

While I wouldn't touch that Hobby Electronics stuff with a disinfected long pole, the programme does compile, and there is no reason to suspect the libraries are obsolete. If they refer you to Miles Burton's site, I assume you get his latest libraries. I therefore suspect you do have a library problem - it's the location, not the contents. I say this despite never seeing that error message before, and I certainly don't understand it, or even why it would have anything to do with a library.

Make sure you have the new libraries located with all the other libraries, probably in a folder named "libraries". You the need to restart the IDE so that it can find where they are.

I raise this because you may have the same problem using the method I referred to. As a precaution, I would also use the libraries from Hacktronics rather than the ones you have.

Well, you're both right! I managed to carefully load the wrong library version, and having made more than one attempt managed to put the (wrong) library into a sub-folder! No wonder it didn't work...

I deleted everything and started again, this time using the links from Hacktronics which all worked just fine.

So, it was a simple mistake on my part in the first place- 3.6.0 is not compatible with >= 1.0 IDE.

Lesson learnt - will write 100 lines:
" I must check which library version I download every time and not just assume it will work with my IDE! "

Many thanks to Riva and Nick for your patient and helpful advice. Sanity(?) has been restored.

Mark