aaa

Dependencies:   BMP280 LGLCDv2

Fork of 0NicksCoursework-lg by Liam Grazier

Files at this revision

API Documentation at this revision

Comitter:
liam_grazier
Date:
Tue Jan 09 06:14:41 2018 +0000
Parent:
8:582ac4c5a524
Commit message:
NICKS CW;

Changed in this revision

Components/components.cpp 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
diff -r 582ac4c5a524 -r e27b3f34de24 Components/components.cpp
--- a/Components/components.cpp	Tue Jan 09 05:43:43 2018 +0000
+++ b/Components/components.cpp	Tue Jan 09 06:14:41 2018 +0000
@@ -49,7 +49,6 @@
 char TEM[6];
 char PRE[5];  
 char LIGHT[6];
-//printf("REFRESH SENSORS\n\r");
 sprintf(TEM,"%.2f", temp);
 sprintf(PRE,"%.2f", pressure);
 sprintf(LIGHT,"%.2f", lightin);
@@ -108,18 +107,6 @@
     while(1)
     {
         Lock2.lock();
-double P = sensor.getPressure();
-double L = adcIn;
-double t = sensor.getTemperature();
-char tem[6];
-char pre[5];  
-char light[6];
-char com[1];
-strcpy(com, ",");
-sprintf(pre,"%.2f", P);
-sprintf(tem,"%.2f",t);
-printf(tem);
-sprintf(light,"%.2f\n\r", L);
 time_t seconds = time(NULL);
 strftime(jdate1, 32, "%F", localtime(&seconds));
 strftime(jdate, 32, "%F\n\r", localtime(&seconds));
@@ -131,6 +118,17 @@
 strcpy(prefix,"/sd/");
 strcpy(suffix,".txt");
 Lock1.lock();
+double P = sensor.getPressure();
+double L = adcIn;
+double t = sensor.getTemperature();
+char tem[6];
+char pre[5];  
+char light[6];
+char com[1];
+strcpy(com, ",");
+sprintf(pre,"%.2f", P);
+sprintf(tem,"%.2f",t);
+sprintf(light,"%.2f\n\r", L);
 sprintf(filename,"%s%s%s",prefix,jdate1,suffix);
 Lock1.unlock();
 FILE* fp = fopen(filename,"a");
diff -r 582ac4c5a524 -r e27b3f34de24 main.cpp
--- a/main.cpp	Tue Jan 09 05:43:43 2018 +0000
+++ b/main.cpp	Tue Jan 09 06:14:41 2018 +0000
@@ -4,7 +4,7 @@
 #include "lglcd.h"
 #include "stx.hpp"
 Thread samplesThread(osPriorityNormal);
-Thread sdThread(osPriorityLow);
+Thread sdThread(osPriorityHigh);
 Thread sdRemoveThread(osPriorityHigh);
 Thread timebuttonThread(osPriorityNormal);
 Thread stxThread(osPriorityLow);
@@ -50,6 +50,7 @@
 int main(){
 lglcd mylcd(D7,D6,D5,D4,D3,D2);
 setuptime();
+printf("NEWIT");
 sdrun();
 lcdstart();
 welcomemsg();