Demo program for the MPL3115A2 library.

Dependencies:   MPL3115A2 mbed

Example program for MPL3115 sensor. Added code for data acquisition using Interrupt.

Files at this revision

API Documentation at this revision

Comitter:
clemente
Date:
Thu Aug 22 14:53:21 2013 +0000
Parent:
3:e2a621ea6976
Child:
5:0f26cb937640
Commit message:
Modified polling code for new function with check of data available.

Changed in this revision

MPL3115A2.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MPL3115A2.lib	Thu Aug 22 12:03:47 2013 +0000
+++ b/MPL3115A2.lib	Thu Aug 22 14:53:21 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/clemente/code/MPL3115A2/#9edec5ee8bf4
+http://mbed.org/users/clemente/code/MPL3115A2/#03c24251e500
--- a/main.cpp	Thu Aug 22 12:03:47 2013 +0000
+++ b/main.cpp	Thu Aug 22 14:53:21 2013 +0000
@@ -51,8 +51,7 @@
 
     while(1) {
         //
-        if ( wigo_sensor1.isDataAvailable()) {
-            wigo_sensor1.getAllData( &sensor_data[0]);
+        if ( wigo_sensor1.getAllData( &sensor_data[0])) {
             if ( mode & 0x0001) {
                 pc.printf("\tPressure: %f\tTemperature: %f\r\n", sensor_data[0], sensor_data[1]);
                 wigo_sensor1.Altimeter_Mode();
@@ -80,8 +79,7 @@
 
     while(1) {
         //
-        if ( wigo_sensor1.isDataAvailable()) {
-            wigo_sensor1.getAllDataRaw( &raw_data[0]);
+        if ( wigo_sensor1.getAllDataRaw( &raw_data[0])) {
             if ( mode & 0x0001) {
                 pc.printf("\tPressure: %f\tTemperature: %f\r\n", print_PressureValue( &raw_data[0]), print_TemperatureValue( &raw_data[3]));
                 wigo_sensor1.Altimeter_Mode();