ESP8266 library to get and send data.

Fork of ESP8266 by Janhavi Kulkarni

Files at this revision

API Documentation at this revision

Comitter:
Wosser1sProductions
Date:
Fri Oct 21 21:24:11 2016 +0000
Parent:
4:c05f7a1b4e47
Commit message:
Added deepsleep command (cannot wake up by pulling CH_PD down and then back up)

Changed in this revision

ESP8266.cpp Show annotated file Show diff for this revision Revisions of this file
ESP8266.h Show annotated file Show diff for this revision Revisions of this file
diff -r c05f7a1b4e47 -r 5cc7894bb8cb ESP8266.cpp
--- a/ESP8266.cpp	Fri Oct 21 16:33:31 2016 +0000
+++ b/ESP8266.cpp	Fri Oct 21 21:24:11 2016 +0000
@@ -132,4 +132,9 @@
     SendCMD(http_cmd);
 }
     
+void ESP8266::deepsleep(size_t ms) {
+    char snd[20];
+    sprintf(snd, "AT+GSLP=%d", ms);
+    SendCMD(snd);
+}
     
\ No newline at end of file
diff -r c05f7a1b4e47 -r 5cc7894bb8cb ESP8266.h
--- a/ESP8266.h	Fri Oct 21 16:33:31 2016 +0000
+++ b/ESP8266.h	Fri Oct 21 21:24:11 2016 +0000
@@ -64,6 +64,8 @@
         void setTransparent(void);
         void startTCPConn(char *IP, int port);
         void sendURL(char *URL, char *IP, char *command);
+        
+        void deepsleep(size_t ms);
 
     private:
         Serial comm;