Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CW_copy by
Diff: data.h
- Revision:
- 0:4e623dbef4b8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/data.h Wed Jan 03 17:32:16 2018 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "BMP280.h"
+float tempf;
+float pressuref;
+float lvl;
+float data_temp [120], data_press[120], data_light[120];
+BMP280 bmp(D14,D15,0x76);
+
+AnalogIn LDR(A0);
+int counterw = 0, full = 0;
+
+void getdata()
+{
+ tempf = bmp.getTemperature();
+ //tempf = tempf*-1;
+ pressuref = bmp.getPressure();
+ lvl = LDR;
+}
+
+void store()
+{
+ data_temp[counterw] = tempf;
+ data_press[counterw] = pressuref;
+ data_light[counterw] = lvl;
+
+ if (counterw == 120)
+ {
+ counterw = 0;
+ full = 1;
+ }
+ counterw++;
+}
+
+
+
