mpl115A2 i2c pressure and temperature sensor
Dependents: HTTPClient_SuperTweet_MPL115A2 mpl115a2_display_local
MPL115A2.h@0:5a72175e5cb2, 2012-05-07 (annotated)
- Committer:
- joeh
- Date:
- Mon May 07 13:24:00 2012 +0000
- Revision:
- 0:5a72175e5cb2
- Child:
- 1:6dbe3322f203
this is a beta version for the
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joeh | 0:5a72175e5cb2 | 1 | /* |
joeh | 0:5a72175e5cb2 | 2 | MPL115A2 Sensor Library for mbed |
joeh | 0:5a72175e5cb2 | 3 | ported to mbed by joe holdsworth <joeholdsworth@gmail.com> |
joeh | 0:5a72175e5cb2 | 4 | created for arduino by R.N <zan73722@gmail.com> |
joeh | 0:5a72175e5cb2 | 5 | |
joeh | 0:5a72175e5cb2 | 6 | 2012-05-07 Ported mbed beta version - tested on LPC1768 |
joeh | 0:5a72175e5cb2 | 7 | */ |
joeh | 0:5a72175e5cb2 | 8 | |
joeh | 0:5a72175e5cb2 | 9 | #ifndef MPL115A2_H |
joeh | 0:5a72175e5cb2 | 10 | #define MPL115A2_H |
joeh | 0:5a72175e5cb2 | 11 | |
joeh | 0:5a72175e5cb2 | 12 | #include "mbed.h" |
joeh | 0:5a72175e5cb2 | 13 | |
joeh | 0:5a72175e5cb2 | 14 | class MPL115A2 |
joeh | 0:5a72175e5cb2 | 15 | { |
joeh | 0:5a72175e5cb2 | 16 | private: |
joeh | 0:5a72175e5cb2 | 17 | DigitalOut _shdnPin; |
joeh | 0:5a72175e5cb2 | 18 | bool _bShutdown; |
joeh | 0:5a72175e5cb2 | 19 | short _i2c_address; |
joeh | 0:5a72175e5cb2 | 20 | short _sia0, _sib1, _sib2, _sic12, _sic11, _sic22; |
joeh | 0:5a72175e5cb2 | 21 | unsigned short _uiPadc, _uiTadc; |
joeh | 0:5a72175e5cb2 | 22 | I2C *_i2c; |
joeh | 0:5a72175e5cb2 | 23 | Serial *_pc; |
joeh | 0:5a72175e5cb2 | 24 | bool _debug; |
joeh | 0:5a72175e5cb2 | 25 | |
joeh | 0:5a72175e5cb2 | 26 | |
joeh | 0:5a72175e5cb2 | 27 | public: |
joeh | 0:5a72175e5cb2 | 28 | MPL115A2(I2C *i2c, const PinName shdnPin = p21); |
joeh | 0:5a72175e5cb2 | 29 | MPL115A2(I2C *i2c, Serial *pc, const PinName shdnPin = p21); //pass serial for debug |
joeh | 0:5a72175e5cb2 | 30 | void begin(); |
joeh | 0:5a72175e5cb2 | 31 | void shutdown(); |
joeh | 0:5a72175e5cb2 | 32 | void ReadSensor(); |
joeh | 0:5a72175e5cb2 | 33 | float GetPressure(); |
joeh | 0:5a72175e5cb2 | 34 | float GetTemperature(); |
joeh | 0:5a72175e5cb2 | 35 | }; |
joeh | 0:5a72175e5cb2 | 36 | #endif |