Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By alain 06640
#13742 if I compile this sketch with Arduino Uno card :
#include <OneWire.h>
void setup() {
}

void loop() {
}
No problem;
If I compile with generic ESP8266 card, I get this error :
In file included from sketch_apr07a.ino:1:0:
#error "Please define I/O register types here"
C:\Users\Alain\Dropbox\arduino sketches\libraries\OneWire/OneWire.h:108:2: error: #error "Please define I/O register
types here"
IDE 1.6.3, latest OneWire
Any ideas ?
Alain
User avatar
By Dennis
#13756 Hello,

I used only the "DS18x20" example sketch.
But you said you got an error regarding IO registers? This means your IDE is using the "normal" OneWire" library located under your "Documents\arduino\libraries" folder, instead of the modified library located in your arduino program folder... (for me, this would be c:\arduino-1.6.1-esp8266\libraries\OneWire for the modified library, and NOT c:\users\dennis\documents\arduino\libraries\OneWire which is the wrong one!!).

(you can see which library path is used, when you enable verbose output for compiling in the arduino IDE, and check the output when testing the sketch). If the library used is the original one, it will fail. In this case I recommend to remove the original "OneWire" folder from your user arduino folder, then restart IDE - and it will use the modified OneWire library.

regards
User avatar
By alain 06640
#13903
Dennis wrote:@Alain, the library is in the libraries folder inside the arduino ide folder. Just add "#include <OneWire.h>" as first line in your sketch.
regards

Hi Dennis, I was using Roger Clarke approach which, apparently, does not deal with libraries modified for ESP.
With arduino-1.6.1-p1-windows, 18B20 works fine. 3.3 kohm to 3.3 V, about same current as 4.7kohm at 5 V
Thank you for your help
Alain