Skovbrynet / Mbed 2 deprecated DustNovaSensor

Dependencies:   EthernetInterface ThingCloud mbed-rtos mbed

Revision:
2:88dce59f9a99
Parent:
1:77bd7a299174
diff -r 77bd7a299174 -r 88dce59f9a99 main.cpp
--- 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()