CPS-Lab1 / Mbed 2 deprecated Lab7

Dependencies:   MPL3115A2 mbed

Committer:
csinders
Date:
Fri Feb 23 17:51:02 2018 +0000
Revision:
0:45ed48d2fec2
Child:
1:84b9a3e560fe
Initial Commit for Lab7

Who changed what in which revision?

UserRevisionLine numberNew contents of line
csinders 0:45ed48d2fec2 1 #include "mbed.h"
csinders 0:45ed48d2fec2 2 #include "MPL3115.h"
csinders 0:45ed48d2fec2 3
csinders 0:45ed48d2fec2 4 Serial pc(USBTX, USBRX);
csinders 0:45ed48d2fec2 5 MPL3115 mpl(PB_7,PB_6);
csinders 0:45ed48d2fec2 6
csinders 0:45ed48d2fec2 7
csinders 0:45ed48d2fec2 8 int main() {
csinders 0:45ed48d2fec2 9 pc.printf("Starting program\r\n");
csinders 0:45ed48d2fec2 10 // Set mpl to active
csinders 0:45ed48d2fec2 11 mpl.MPL3115::MPL3115_config();
csinders 0:45ed48d2fec2 12 while (1) {
csinders 0:45ed48d2fec2 13 float test;
csinders 0:45ed48d2fec2 14 mpl.acquire_MPL3115_data_Altitude_in_m(&test);
csinders 0:45ed48d2fec2 15 pc.printf("test = %f\r\n", test);
csinders 0:45ed48d2fec2 16 wait_ms(100);
csinders 0:45ed48d2fec2 17 }
csinders 0:45ed48d2fec2 18 }