nova sps011 sensor

Dependencies:   EthernetInterface ThingCloud mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
gert_lauritsen
Date:
Fri Jun 09 22:50:27 2017 +0000
Parent:
1:77bd7a299174
Commit message:
Opdateret kun de rigtige felter inden 0 'er

Changed in this revision

Config.h Show annotated file Show diff for this revision Revisions of this file
ThingCloud.lib 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Config.h	Fri Jun 09 22:50:27 2017 +0000
@@ -0,0 +1,12 @@
+//Config data
+
+int stationID=0;
+float VindDirection=0;
+float latitude[10]={56.393573,56.391227,56.39206589,3,4,5,6,7,8,9};
+float longitude[10]={10.420280,10.414798,10.42156219,3,4,5,6,7,8,9};
+
+
+//Hjemme nr 0 56.393573, 10.420280) nr0
+//Henrik nr 1 56.391227, 10.414798  nr1
+//Thomas nr 2
+//
\ No newline at end of file
--- a/ThingCloud.lib	Sat Jun 03 17:52:26 2017 +0000
+++ b/ThingCloud.lib	Fri Jun 09 22:50:27 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/Skovbrynet/code/ThingCloud/#f2978b94215f
+https://developer.mbed.org/teams/Skovbrynet/code/ThingCloud/#8dd66dae7b77
--- a/main.cpp	Sat Jun 03 17:52:26 2017 +0000
+++ b/main.cpp	Fri Jun 09 22:50:27 2017 +0000
@@ -1,10 +1,14 @@
 #include "mbed.h"
 #include "EthernetInterface.h"
 #include "thingspeak.h"
+#include "Config.h"
 
 #define samplingTime 280
 //#define apikey "EBQZGHVA0T7U04MZ"
 #define apikey "SOMJ5VHIL690SNC8" //single sensor
+#define readapikey "73DW768IEIMGF66B" //single sensor
+
+#define apiID 133611
 #define off 1
 #define on 0
 #define OldSensor 1
@@ -12,6 +16,8 @@
 
 EthernetInterface eth;
 char* thingSpeakKey = apikey;
+char* thingSpeakReadKey = readapikey;
+
 THINGSPEAK Channel;
 
 Serial pc(USBTX, USBRX);     // serial comms over usb back to console
@@ -35,13 +41,15 @@
 {
     Channel.AddFloat(PM10/stack);
     Channel.AddFloat(PM25/stack);
-    Channel.AddFloat(0);
-    Channel.AddFloat(0);
+  //  Channel.AddFloat(0);
+  //  Channel.AddFloat(0);
+    Channel.AddPosition(latitude[stationID],longitude[stationID]);
     stack=0;
     PM10=0;
     PM25=0;
     if (Channel.SendData(thingSpeakKey)) pc.printf("Upload Error                     \r");
     else pc.printf("Upload OK                    \r");
+    //Channel.ReadData(thingSpeakReadKey,apiID);
 }
 
 int ReadNova()