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.
Dependencies: wifi-ism43362
Dependents: DigitalOut DigitalOut
Revision 16:0a60a1530987, committed 2020-05-26
- Comitter:
- marcel1691
- Date:
- Tue May 26 17:34:16 2020 +0000
- Parent:
- 15:a57126cdcc98
- Commit message:
- Ohne BMP180 Wrapper
Changed in this revision
| BMP180Wrapper.cpp | Show diff for this revision Revisions of this file |
| BMP180Wrapper.h | Show diff for this revision Revisions of this file |
--- a/BMP180Wrapper.cpp Tue May 26 17:29:43 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/**
- * Bosch BMP180 Digital Pressure Sensor
- */
-
-#include <BMP180Wrapper.h>
-
-BMP180Wrapper::BMP180Wrapper( DevI2C* i2c ) : bmp180(i2c)
-{
-}
-
-int BMP180Wrapper::init( void* init )
-{
- while ( 1 )
- {
- if ( bmp180.init() != 0 )
- {
- printf( "Error communicating with BMP180\n" );
- }
- else
- {
- printf( "Initialized BMP180\n" );
- break;
- }
- wait( 1 );
- }
- return ( 0 );
-}
-
-int BMP180Wrapper::read_id( uint8_t* id )
-{
- *id = 0x55;
- return ( 0 );
-}
-
-int BMP180Wrapper::get_humidity( float* pfData )
-{
- *pfData = 0.0f;
- bmp180.startPressure(BMP180::ULTRA_LOW_POWER);
- wait_ms(10); // Wait for conversion to complete
- int pressure;
- if(bmp180.getPressure(&pressure) == 0)
- {
- *pfData = pressure / 1000.0f;
- }
- return ( 0 );
-}
-
-int BMP180Wrapper::get_temperature( float* pfData )
-{
- bmp180.startTemperature();
- wait_ms( 5 ); // Wait for conversion to complete
- return ( bmp180.getTemperature( pfData ) );
-}
-
-int BMP180Wrapper::enable( void )
-{
- return ( 0 );
-}
--- a/BMP180Wrapper.h Tue May 26 17:29:43 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/**
- * Bosch BMP180 Digital Pressure Sensor
- *
- */
-
-#ifndef BPM180_BMP180WRAPPER_H_
-#define BPM180_BMP180WRAPPER_H_
-
-#include <BMP180.h>
-#include "mbed.h"
-#include "DevI2C.h"
-
-class BMP180Wrapper
-{
-public:
- BMP180Wrapper(DevI2C *i2c);
- virtual int init(void *init);
- virtual int read_id(uint8_t *id);
- virtual int get_humidity(float *pfData);
- virtual int get_temperature(float *pfData);
- int enable(void);
-private:
- BMP180 bmp180;
-};
-
-#endif /* BPM180_BMP180WRAPPER_H_ */