worked to reduce program size

Dependencies:   mbed

Committer:
giovanniwsn
Date:
Sun Oct 14 03:29:55 2018 +0000
Revision:
0:620064decfb0
LPS_25H_capada, to reduce code size

Who changed what in which revision?

UserRevisionLine numberNew contents of line
giovanniwsn 0:620064decfb0 1 #include "mbed.h"
giovanniwsn 0:620064decfb0 2 #include "LPS25H.h"
giovanniwsn 0:620064decfb0 3
giovanniwsn 0:620064decfb0 4 Serial pc(USBTX, USBRX);// Serial Debug.
giovanniwsn 0:620064decfb0 5
giovanniwsn 0:620064decfb0 6 DigitalOut myled(LED1);
giovanniwsn 0:620064decfb0 7 LPS25H baro(p28, p27);
giovanniwsn 0:620064decfb0 8
giovanniwsn 0:620064decfb0 9 int main() {
giovanniwsn 0:620064decfb0 10 float alt, Bpress;
giovanniwsn 0:620064decfb0 11
giovanniwsn 0:620064decfb0 12
giovanniwsn 0:620064decfb0 13 while(1) {
giovanniwsn 0:620064decfb0 14
giovanniwsn 0:620064decfb0 15 baro.get();
giovanniwsn 0:620064decfb0 16 Bpress = baro.pressure();
giovanniwsn 0:620064decfb0 17 alt = baro.altitude();
giovanniwsn 0:620064decfb0 18
giovanniwsn 0:620064decfb0 19 pc.printf("pre: %.3f alt: %.3f\n", Bpress, alt);
giovanniwsn 0:620064decfb0 20
giovanniwsn 0:620064decfb0 21 myled = 1;
giovanniwsn 0:620064decfb0 22 wait(0.5);
giovanniwsn 0:620064decfb0 23 myled = 0;
giovanniwsn 0:620064decfb0 24 wait(0.5);
giovanniwsn 0:620064decfb0 25 }
giovanniwsn 0:620064decfb0 26 }