How can I read data from BMP 280 bosch sensor with STM32F0 Discovery kit via I2C.
- August 16, 2019
- 2 replies
- 2488 views
I am trying to read data from from BMP 280 bosch sensor but could not able to do , Any expertise on I2C/ Bosch sensor please?
I could able to communicate with my sensor by checking if the device address is right or wrong using function : HAL_I2C_IsDeviceReady(&hi2c1, 0xED,2,10). But I would like to read humidity and temperature from the sensor, I used the following functions but of no use.
HAL_I2C_Master_Transmit(&hi2c1, 0XEC,buffer, 1,100);
and HAL_I2C_Master_Receive( above parameters) ;
didnt get the data in buffer so used memory write and read in i2c but of no use!!
HAL_I2C_Mem_Write(&hi2c1, 0xEC,0XFD, 1, buffer, 1, 100);
Below I have attached the data sheet of Bosch sensor, I am aware to some extent that inorder to receive data of humidity sensor i have to write the register 0XFD and for Temperature has to write data to register 0XFA
Bosch also have drivers for this sensor, Do I need to use these drivers to get the data of temperature ? or HAL's API is sufficient? I am learning ,I do not know how to proceed! I had a glance of files of Bosch drivers, again do not know which functions to be used to get the value of Temperature from driver files of Bosch sensor.
https://github.com/BoschSensortec/BMP280_driver/tree/master/examples
Using STM32F0 discovery kit via I2c,
Any insights are much appreciated.