Kenji Arai / LPC1114_barometer_with_data_logging

Barometer program : Data Logger function includes Barometer & temperature (BMP180), Humidity & temp. (RHT03), Sunshine (Cds), RTC(M41T62) data. : Logging data saves into EEPROM (AT24C1024) using ring buffer function.

Dependencies:   AT24C1024 BMP180 M41T62 RHT03 TextLCD mbed

Fork of mbed_blinky by mbed

Please see https://mbed.org/users/kenjiArai/notebook/mbed-lpc1114fn28-barometer-with-data-logging/#

main_bmp180.h

Committer:
kenjiArai
Date:
2014-06-22
Revision:
14:18a98cad6109

File content as of revision 14:18a98cad6109:

/*
 * mbed Application program for the mbed LPC1114FN28
 * Test program -> Check RTC module
 *
 * Copyright (c) 2014 Kenji Arai / JH1PJL
 *  http://www.page.sannet.ne.jp/kenjia/index.html
 *  http://mbed.org/users/kenjiArai/
 *      Created: June      22nd, 2014
 *      Revised: June      22nd, 2014
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#include "mbed.h"
#include "BMP180.h"             // Own lib. / Pressure sensor             

Serial      pc(dp16,dp15);      // UART (vertual COM)
#if 1
BMP180      bmp180(dp5,dp27);   // Bosch sensor
#else
I2C         i2c(dp5,dp27);      // SDA, SCL
BMP180      bmp180(i2c);        // Bosch sensor
#endif
   
//-------------------------------------------------------------------------------------------------
//  Control Program
//-------------------------------------------------------------------------------------------------
int main() {
    pc.baud(9600);
    pc.printf("\r\nmbed LPC1114FN28 BMP180 test by JH1PJL created on "__DATE__"(UTC)\r\n"); 
    while(1) {
    //  ---------- Barometer Sensor / BMP180 --------------------------------------------------
        bmp180.normalize();
        pc.printf("Pres:%4.1fhPa, Temp:%\+-0.1fdegC\r\n",
                bmp180.read_pressure(), bmp180.read_temperature());
        wait(1.0);
    }
}