I’ve put together a port of the Arduino DallasTemperature Library and used the OneWire Library posted by forum user tidwelltimj.

It’s in designed for use with command line compilation and not for the web based IDE this stage.

Check it out here.


thanks! i was planning on trying that but wasn’t quite sure how and i haven’t started flashing the spark core locally yet.

does everything compile and work?

i can confirm, everything compiles and works.

this is great! thank you

Thanks @mrOmatic!

So what’s involved getting this (or any library converted by the community) onto the web based IDE?

thats a great question for @zachary or @zach
i think there should be an entire thread dedicated to how the community would like to see libraries supported.

Thanks for pulling us in @avidan.

All the questions around library architecture are very important; additionally, the features that must be built to incorporate external code are nontrivial.

That said, we already have portions of the infrastructure in progress. When we plan our next sprint beginning January 6 (after everyone is back from incredibly well deserved holidays), the architecture roadmap for libraries will be near the top of the priority list.

That means that the Spark community can expect an update at the latest over the Jan 18–19 weekend on http://blog.spark.io/ when we summarize the sprint.


Over on brewpi.com we are making use of the DS18B20, in particular in asynchornous mode, so that we can request each sensor to start temp conversion, then go way for 750ms and come back and get the results. That way you don’t take a 750ms hit for each sensor, but one hit for all of them.

There are also some fixes and space optimizations. I hope we can merge our changes into whatever becomes the “official” spark library.

I’ve written a onewire implementation that offloads the bus timing to the USART on the STM32. This frees your main loop from having to wait while the onewire reads and writes are bit-banged out on the bus, although it requires some (simple) external hardware. In the included sample I show how to use DS18B20 in this asynchronous mode.

Once the library architecture is defined I would like to include this as another option for getting OneWire access to the core. In the meantime, you can checkout the git repository in my form post: https://community.spark.io/t/interrupt-driven-onewire-bus-using-usart-hardware/1189


now where the ide support multiple files i tryed to put the .h and .cpp files in but i cant get it to compile
what to do?

How do I use this library in cloud software? I’ve copy-pasted .h and .c files, got rid of include <OneWire.h>, but can’t compile with pretty weird error: http://screenshots.ryotsuke.ru/scr_9e358b100eff.png

Gist code

UPD: deleting this code part somehow resolves the issue http://screenshots.ryotsuke.ru/scr_b3e65bfa4dcd.png

I haven’t had a chance to look at the new multi file feature in the web IDE. I’m still working from the command line and that’s unlikely to change. I’m also pretty busy on other projects right now. I’ll take a look when i get time, once the up coming shared library feature are in i’ll find the web IDE more enticing.

If you like one file, you basically copy-paste .h and .cpp files to beginning of application file and remove include from top of .cpp