Karkhana Makerspace
/
OnlyThingspeak
Uploading esp8266
Revision 3:a19e84b2585e, committed 2018-09-07
- Comitter:
- mrbhatter
- Date:
- Fri Sep 07 11:19:36 2018 +0000
- Parent:
- 2:97dbf542ebee
- Commit message:
- ABIT
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 97dbf542ebee -r a19e84b2585e main.cpp --- a/main.cpp Sun Dec 03 13:10:28 2017 +0000 +++ b/main.cpp Fri Sep 07 11:19:36 2018 +0000 @@ -14,20 +14,20 @@ char resp[1000]; char http_cmd[300], comm[300]; -int timeout = 8000; //timeout for wifi commands +int timeout = 3000; //timeout for wifi commands //SSID and password for connection -#define SSID "Tenda_43DA50" -#define PASS "Karkhana" +#define SSID "Siddharth Bhatter" +#define PASS "123karkhana" //Remote IP -#define IP "184.106.153.149" // 52.202.122.57 +#define IP "184.106.153.149" // 52.54.134.167 //global variable float potvalue = 0; -float litvalue = 0; +//float litvalue = 0; //Update key for thingspeak -char* Update_Key = "P2GMSKA9NY7KV0LW"; +char* Update_Key = "6IGKSPRI4MW9O8EF"; //Wifi init function void wifi_initialize(void) @@ -99,7 +99,7 @@ wait(1); //create link - sprintf(http_cmd,"/update?api_key=%s&field2=%f&field1=%f",Update_Key,litvalue,potvalue); + sprintf(http_cmd,"/update?api_key=%s&field1=%f",Update_Key,potvalue); pc.printf(http_cmd); @@ -115,11 +115,11 @@ { wifi_initialize(); while (1) { - potvalue = 255*pot.read(); - litvalue = lit.read(); + potvalue = pot.read(); + //litvalue = lit.read(); pc.printf("Current potvalue is = %.3f \r\n", potvalue); - pc.printf("Current light value is = %.3f \r\n", litvalue); + //pc.printf("Current light value is = %.3f \r\n", litvalue); wifi_send(); - wait(30); + wait(5); } } \ No newline at end of file