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.
Fork of BMP280 by
Diff: BME280.cpp
- Revision:
- 2:c35f637c28ef
- Parent:
- 1:763a4018aaec
- Child:
- 3:d4eb81284ea0
--- a/BME280.cpp Mon Apr 06 09:19:41 2015 +0000 +++ b/BME280.cpp Sat Apr 11 15:47:58 2015 +0000 @@ -85,14 +85,17 @@ cmd[0] = 0xA1; // read dig_H regs i2c.write(address, cmd, 1); - i2c.read(address, cmd, 9); - + i2c.read(address, cmd, 1); + cmd[1] = 0xE1; // read dig_H regs + i2c.write(address, &cmd[1], 1); + i2c.read(address, &cmd[1], 7); + dig_H1 = cmd[0]; dig_H2 = (cmd[2] << 8) | cmd[1]; dig_H3 = cmd[3]; dig_H4 = (cmd[4] << 4) | (cmd[5] & 0x0f); - dig_H5 = (cmd[7] << 4) | ((cmd[6]>>4) & 0x0f); - dig_H6 = cmd[8]; + dig_H5 = (cmd[6] << 4) | ((cmd[5]>>4) & 0x0f); + dig_H6 = cmd[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); }