ELEC

Dependencies:   BME280 BMP280 TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers data.h Source File

data.h

00001 #include "mbed.h"
00002 #include "BMP280.h"
00003 float tempf;
00004 float pressuref;
00005 float lvl;
00006 float data_temp [120], data_press[120], data_light[120];
00007 BMP280 bmp(D14,D15,0x76);
00008 
00009 AnalogIn LDR(A0);
00010 int counterw = 0, full = 0;
00011 
00012 void getdata()
00013 {
00014     tempf = bmp.getTemperature();
00015     //tempf = tempf*-1;
00016     pressuref = bmp.getPressure();
00017     lvl = LDR;
00018 }
00019 
00020 void store() 
00021 {  
00022      data_temp[counterw] = tempf;
00023      data_press[counterw] = pressuref;
00024      data_light[counterw] = lvl;
00025      
00026      if (counterw == 120)
00027      {
00028          counterw = 0;
00029          full = 1;
00030      }
00031      counterw++;
00032 }
00033 
00034 
00035