stanleyhuangyc / Freematics

Official source code repository for Freematics
https://freematics.com
425 stars 346 forks source link

esp8266test error compiling #79

Open ghost opened 5 years ago

ghost commented 5 years ago

Just got the FreematicsOne and gave the esp8266test example a try, but it failed with "Error compiling".

Arduino IDE output details, if not including (IDE's) Wire.h library:

/home/corrado/sketchbook/libraries/FreematicsONE/FreematicsMEMS.cpp:9:18: fatal error: Wire.h: No such file or directory
 #include <Wire.h>
                  ^
compilation terminated.

Arduino IDE output details, if including (IDE's) Wire.h library:

/home/corrado/sketchbook/libraries/FreematicsONE/FreematicsMEMS.cpp: In member function ‘virtual byte MPU9250_ACC::begin(bool)’:
/home/corrado/sketchbook/libraries/FreematicsONE/FreematicsMEMS.cpp:561:8: error: ‘class TwoWire’ has no member named ‘setClock’
   Wire.setClock(400000);
        ^
/home/corrado/sketchbook/libraries/FreematicsONE/FreematicsMEMS.cpp: In member function ‘virtual byte MPU9250_9DOF::begin(bool)’:
/home/corrado/sketchbook/libraries/FreematicsONE/FreematicsMEMS.cpp:589:8: error: ‘class TwoWire’ has no member named ‘setClock’
   Wire.setClock(400000);
        ^

I installed "standard" ArduinoIDE on debian9, maybe that one carries an older version for Wire.h?

And what's that "TwoWire" class?

ghost commented 5 years ago

BTW: the "standard" Wire.h class (the one in /usr/share/arduino/libraries/Wire) is quite strange:

1) actually there's no setClock method there, not even in the Stream.h it extends

2) the Wire.h only defines this class: class TwoWire : public Stream

any hints?