maarten-pennings / iAQcore

Arduino library for the iAQ-core indoor air quality sensor module with I2C interface
MIT License
15 stars 7 forks source link

Setting SDA and SCL pins #4

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello Maarten,

The examples show a function being called to setup Wire:

Wire.begin(/*SDA*/D2,/*SCL*/D1);

When using this library in PlatformIO with the Arduino framework I had to set SDA and SCL separately:

Wire.setSDA(SDA);
Wire.setSCL(SCL);
Wire.begin();

Based on current Arduino documentation, they might've changed Wire's 'begin' function to only accept an address rather than set SDA and SCL pins.

After this change is made, the code successfully runs on an STM32L031K6 microcontroller.

maarten-pennings commented 4 years ago

The wire.begin is a bit messy over the various libraries (how to pass the sda/scl lines). Sorry for - but I can't fix that. Happy you got it working!

maarten-pennings commented 4 years ago

I did add a comment in iAQcore-basic.ino

ghost commented 4 years ago

Thank you!