Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Auto_pilot_prototype_3_2
Revision 6:7c4db7db09eb, committed 2020-05-23
- Comitter:
- Joeatsumi
- Date:
- Sat May 23 13:16:02 2020 +0000
- Parent:
- 5:c1f1647004c4
- Commit message:
- i2c frequency was changed to 400kHz in .cpp file
Changed in this revision
| BME280.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r c1f1647004c4 -r 7c4db7db09eb BME280.cpp
--- a/BME280.cpp Sat Mar 11 04:21:14 2017 +0000
+++ b/BME280.cpp Sat May 23 13:16:02 2020 +0000
@@ -55,9 +55,12 @@
if (NULL != i2c_p)
delete i2c_p;
}
-
+
void BME280::initialize()
{
+ //I2C initialization
+ i2c.frequency(400000); //400 kHz
+
char cmd[18];
cmd[0] = 0xf2; // ctrl_hum
@@ -114,7 +117,7 @@
DEBUG_PRINT("dig_H = 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", dig_H1, dig_H2, dig_H3, dig_H4, dig_H5, dig_H6);
}
-
+
float BME280::getTemperature()
{
uint32_t temp_raw;