Go Down

Topic: onewire.h error compiling (Read 4529 times) previous topic - next topic


I'm having an issue getting the onewire library going on my Due. I have the nightly build of the of IDE 1.5.2, from http://downloads.arduino.cc/arduino-nightly-windows.zip, and the version 2.2 of the onewire library from http://www.pjrc.com/teensy/td_libs_OneWire.html.

However every time I try to compile the DS18x20_Temperature sketch I get this error:
Code: [Select]

Arduino: nightly (Windows 7), Board: "Arduino Due (Programming Port)"
In file included from DS18x20_Temperature.pde:1:
C:\Users\laptop\Documents\Arduino\libraries\OneWire/OneWire.h:77: error: #error "Please define I/O register types here"
C:\Users\laptop\Documents\Arduino\libraries\OneWire/OneWire.h:84: error: 'IO_REG_TYPE' does not name a type
C:\Users\laptop\Documents\Arduino\libraries\OneWire/OneWire.h:85: error: ISO C++ forbids declaration of 'IO_REG_TYPE' with no type
C:\Users\laptop\Documents\Arduino\libraries\OneWire/OneWire.h:85: error: expected ';' before '*' token

Any ideas? I'm using a Due in my project to have a much easier time running the display that I already have mounted in the control panel. I'm new to arduino but have done some programing in the past. This seem like a solvable problem, but there is a very steep learning curve in front of me to figure it out with no help.


Have you modified your OneWire.h? Maybe accidentally?
Because i looked at the original version 2.2 OneWire.h and the line numbers don't match with your error report.

Anyways, your first error:
Code: [Select]
OneWire.h:77: error: #error "Please define I/O register types here"
is not a compiler error, but a user defined preprocessor error.
The reason you get this error is because:
Code: [Select]
#if defined(__AVR__)
#elif defined(__MK20DX128__)
#elif defined(__SAM3X8E__)
#elif defined(__PIC32MX__)
#error "Please define I/O register types here"   //<-- this is line number 108 for me

Notice that "Please define I/O register types here" is at line number 108 in my original version 2.2 "OneWire.h". So maybe you accidentally deleted some lines there.


Problem solved, thanks! Was making the stupid mistake of changing the libraries in the wrong location. I realized the error line numbers didn't match my file but it took someone else pointing that out to realize what the problem was.

Go Up