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.
BMP280.h@0:0bb635158791, 2018-04-25 (annotated)
- Committer:
- claragh_patton
- Date:
- Wed Apr 25 09:35:02 2018 +0000
- Revision:
- 0:0bb635158791
First Commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| claragh_patton | 0:0bb635158791 | 1 | #include "mbed.h" |
| claragh_patton | 0:0bb635158791 | 2 | #define BMP280_R_ADDRESS (0x76 << 1) |
| claragh_patton | 0:0bb635158791 | 3 | //DigitalOut myled(LED1); |
| claragh_patton | 0:0bb635158791 | 4 | |
| claragh_patton | 0:0bb635158791 | 5 | |
| claragh_patton | 0:0bb635158791 | 6 | class BMP280 |
| claragh_patton | 0:0bb635158791 | 7 | { |
| claragh_patton | 0:0bb635158791 | 8 | public: |
| claragh_patton | 0:0bb635158791 | 9 | BMP280(); |
| claragh_patton | 0:0bb635158791 | 10 | //Declaring Parameters |
| claragh_patton | 0:0bb635158791 | 11 | double ReadPressure(); |
| claragh_patton | 0:0bb635158791 | 12 | double ReadTemperature(); |
| claragh_patton | 0:0bb635158791 | 13 | double RawPressure(); |
| claragh_patton | 0:0bb635158791 | 14 | double RawTemperature(); |
| claragh_patton | 0:0bb635158791 | 15 | int BMP280RegisterWrite(uint8_t RegNum, uint8_t Value);//Declaring Write Register |
| claragh_patton | 0:0bb635158791 | 16 | int BMP280RegisterRead(uint8_t RegNum, uint8_t *Value);//Declaring Read Register |
| claragh_patton | 0:0bb635158791 | 17 | private: |
| claragh_patton | 0:0bb635158791 | 18 | #define CAL_START 0x88 //Defining the address where the calibration data should start |
| claragh_patton | 0:0bb635158791 | 19 | |
| claragh_patton | 0:0bb635158791 | 20 | //Reads factory calibration data |
| claragh_patton | 0:0bb635158791 | 21 | void ReadCalibrationData(); |
| claragh_patton | 0:0bb635158791 | 22 | uint8_t CalibrationData[26];//Creating an array of 26 calibration addresses |
| claragh_patton | 0:0bb635158791 | 23 | //Declaring calibration for temperature & pressure |
| claragh_patton | 0:0bb635158791 | 24 | uint16_t dig_T1;//calibration for temperature |
| claragh_patton | 0:0bb635158791 | 25 | int16_t dig_T2;//calibration for temperature |
| claragh_patton | 0:0bb635158791 | 26 | int16_t dig_T3;//calibration for temperature |
| claragh_patton | 0:0bb635158791 | 27 | uint16_t dig_P1;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 28 | int16_t dig_P2;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 29 | int16_t dig_P3;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 30 | int16_t dig_P4;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 31 | int16_t dig_P5;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 32 | int16_t dig_P6;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 33 | int16_t dig_P7;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 34 | int16_t dig_P8;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 35 | int16_t dig_P9;//calibration for pressure |
| claragh_patton | 0:0bb635158791 | 36 | }; |
| claragh_patton | 0:0bb635158791 | 37 |