Working code from Niranjan
Revision 4:42dd8d5d118b, committed 2018-11-28
- Comitter:
- Niranjan_ravi
- Date:
- Wed Nov 28 21:24:22 2018 +0000
- Parent:
- 3:164296bb4985
- Commit message:
- ESP8266_Niranjan
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat May 06 21:17:22 2017 +0000
+++ b/main.cpp Wed Nov 28 21:24:22 2018 +0000
@@ -3,10 +3,10 @@
#include "math.h"
#include <string>
-#define APIKEY E3AASCJVE2KQDD3V //Put "Write key" of your channel in thingspeak.com
+#define APIKEY W4VWN2SK5LC1VZ9Z //Put "Write key" of your channel in thingspeak.com
#define IP "184.106.153.149" // IP Address of "api.thingspeak.com\"
-#define WIFI_SSID "Redmi"
-#define WIFI_PASS "akash12345"
+#define WIFI_SSID "Niran"
+#define WIFI_PASS "12345678910"
Serial pc(USBTX,USBRX);
@@ -50,7 +50,7 @@
pc.printf("Reset ESP\r\n");
esp.Reset(); //RESET ESP
esp.RcvReply(rcv, 400); //receive a response from ESP
- //pc.printf(rcv); //Print the response onscreen
+ pc.printf(rcv); //Print the response onscreen
wait(2);
strcpy(snd,"AT");
@@ -105,7 +105,8 @@
pc.printf("R\r\n%s",rcv);
wait(1);
- sprintf(snd,"GET https://api.thingspeak.com/update?key=E3AASCJVE2KQDD3V&field1=%f&field2=%f\r\n",i,j);
+ //sprintf(snd,"GET https://api.thingspeak.com/update?key=E3AASCJVE2KQDD3V&field1=%f&field2=%f\r\n",i,j);
+ sprintf(snd,"GET https://api.thingspeak.com/update?key=W4VWN2SK5LC1VZ9Z&field1=%f&field2=%f\r\n",i,j);
int i=0;
for(i=0;snd[i]!='\0';i++);