My goal is:
to read temperature and humidity from an HDC1080, which is an I2C device. Since I can’t find a mongoose library I need to write or port something. I tried writing a driver using the Mongoose I2C library, but can’t get readings out of it (likely a timing issue). There’s an Arduino driver (ClosedCube_HDC1080). So |'m trying to follow the instructions for porting it to Mongoose.
My actions are:
Following the guidance at https://mongoose-os.com/docs/mongoose-os/userguide/build.md, I’ve created library directory “arduino_closedcube_hdc1080” in deps; moved the CodeCube source in there; created “mgos_arduino_ClosedCube_HDC1080”.h/cpp/c files; added “-origin: https://github.com/mongoose-os-libs/arduino-wire” and “- name: arduino_closedcube_hdc1080” to mos.yml; and included “mgos_arduino_ClosedCube_HDC1080.h” and “Wire.h” in main.cpp
The result I see is:
compile error: “error: ‘class TwoWire’ has no member named ‘readBytes’”
The compiler is choking on “arduino_closedcube_hdc1080/src/ClosedCube_HDC1080.cpp” (the original source code), and appears not to have the header file available defining “readBytes”.
- My expectation & question is:
I’d expect the file to compile.
I have to say the guidance at https://mongoose-os.com/docs/mongoose-os/userguide/build.md is a little brief for my skill level, and there appear to be inconsistencies between the text and the example provided which are compounding my confusion.
May | ask for some guidance on how to configure the wrappers correctly to get this going? Many thanks