[Solved] OneWire library fails to compile on my RFduino

I appreciate that this is because I’m using a device that I imagine isn’t that popular compared to other Arduino’s, but I’ve been attempting to compile my script on a RFduino that reads from a OneWire temperature sensor. My code compiles fine on my Uno but fails on my RFduino, and it fails when calling the header file:

#include <OneWire.h>

Error:

.../OneWire/OneWire.h:108: error: #error "Please define I/O register types here"
.../OneWire/OneWire.h:115: error: 'IO_REG_TYPE' does not name a type
.../OneWire/OneWire.h:116: error: ISO C++ forbids declaration of 'IO_REG_TYPE' with no type
.../OneWire/OneWire.h:116: error: expected ';' before '*' token

Note: I’m running version 2.2 of the OneWire library.

When researching into this I’ve found that other users have experienced this when trying with a device that is not supported by the library, however I found a post by someone claiming they have got this to work: http://forum.rfduino.com/index.php?topic=103.msg261#msg261. This forum has is now annoyingly closed for some reason, so I’m looking for advice here. Does it look possible without re-writing or modifying libraries?

Show us your code: See #7 http://forum.arduino.cc/index.php/topic,148850.0.html

LarryD:
Show us your code:
See #7
http://forum.arduino.cc/index.php/topic,148850.0.html

I read #7 when I joined the forum, and this is exactly what I did in my post. I’m assuming it’s because it isn’t a full sketch, so for convenience I have posted it below.

Please keep in mind that I am just attempting to get a sensor to work here, nothing more. It doesn’t really matter what my code is because the problem caused when loading the OneWire library, and that is literally the first thing I do.

I don’t expect anyone to have much experience with this device, so I’m only looking to trouble someone else who has attempted this already. If you want to reproduce the error then run Arduino 1.5.5 beta with the RFduino files installed, import the OneWire library, change the board to RFduino, write the sketch below and then click verify:

#include <OneWire.h>

// DS18S20 Temperature sensor
OneWire ds(8);

void setup(void)
{
}

void loop()
{
}

Then change the board to Arduino Uno and click verify and it compiles just fine.

This is that code compiled for my Arduino Uno:

And this is the build failing for my RFduino:

I am yet to write any more code because it doesn’t compile for the device I was intending to use…

Solved.

The RFduino forums (which were taken down as a precautionary measure due to some licensing issues they were having) are back online, and the post I referenced above is working again and I can confirm that the fix there works!

For anyone else trying to do this, the RFduino isn't supported by the OneWire library (v2.2) for arduino found on this page. However, some bright spark on this post has created a modified version of the library to get this working (look at the post for more info). They've also included some sample code, however all I had to do was use their library and everything just worked!