Using DallasTemperature.h libary

Hi
I want to use the DS18B20 sensor with my “core” I started by downloading “onewire.h” and “DallasTemperature.h” into my Arduino IDE and wrote a simple sketch to print degrees Celsius to the serial monitor and all was fine. I wanted to write a similar sketch within the particle IDE but could not find the library’s, although they were in the Arduino IDE. Please can anyone explain to me why, as simply as possible? and maybe offer a solution?

thanks

Because Particle is not Arduino. That said, have you looked for “ds18b20” in the library system, because this is what I find: https://build.particle.io/libs/DS18B20/

1 Like

Hi
Ok I see it now will try it, thanks, where do I find the way to use it, the commands to get temperature and things, I thought particle used the library’s in the Arduino IDE, I live and learn. Thanks!

If you look at the library in the web IDE, you’ll notice it has some examples showing how you could use it.
Though Particle is generally very similar, and in many instances ‘compatible’ with Arduino, they’re still different. As such, libraries may require minor changes to make them work on different hardware. The Arduino IDE isn’t/can’t be used for Particle development. The Web IDE and the announced-today desktop IDE: Particle Workbench are the Particle tools used for development. Alternatively, there’s also the CLI if you’re into that.

So having a library in the Arduino IDE does not automatically mean it can be used in the Particle IDE, but I still download 3rd party library’s to the Arduino IDE. Can I download 3rd party stuff to the particle IDE directly? Is the desktop IDE available for download now? and how will it manage library’s? (sorry I will get this!) as for the DS18B20 library, I have had at look at an example and within the “getTemp” function there is a statement " temp = ds18b29.getTempperature();" will this set temp to the temperature in Celsius? for me to do with it as I will?

Of course not. These are two completely independent applications by too non-related “companies”.

Depends which Particle IDE you are using and where you intend to get the 3rd party library from.

Yes, both of them

We can come to this once you’ve installed the IDE.

1 Like