Working libraries, libraries being ported and related hardware
- Posts: 1
- Joined: Mon Mar 28, 2016 2:53 pm
just tested BMP085 and HTU21D libraries from Adafruit with HardWire and they work very good!
I had to slightly modify both libraries:
remove #include "Wire.h"
in both .h and .cpp files
add #include "HardWire.h"
only in .cpp files
replace all Wire
in all .cpp files
remove #include <util/delay.h>
from Adafruit_HTU21DF.cpp (no reason to include it as it is already defined somewhere else)
At the beginning of the sketch it is required to include HardWire and define Hwire with specific i2c port (1 or 2):
Code: Select all
HardWire HWire(1, I2C_FAST_MODE);
this all works on a STM32F103C blue pill board (with yellow jumpers)
- Posts: 5923
- Joined: Mon Apr 27, 2015 10:36 am
- Location: Melbourne, Australia
I think a number of people have tried the BMP085 using Wire but not Hardwire, but I dont recall anyone using that display before.
- Posts: 19
- Joined: Sun Feb 26, 2017 12:01 pm
I have been trying to run the measurement with HTU21D since few days, but with no success.
I have mad the changes in the .cpp files (wire exchanged by HWire) and connected the sensor to PB7 and PB6 (Pull up 4.7k and 3.3V VCC)
All I get ist 998 (time out).
Can you please give me any hint, which could help me, or your sketch and the relevant cpp files?
Thanks a lot!
Who is online
Users browsing this forum: Aleksey78 and 1 guest