![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Use ESP8266 to connect ThingSpeak.com
Drive to connect with ThingSpeak.com,
it`s work well, but it don`t provided return message
you can send "int" "float" "char".
ESP8266和ThingSpeak.com的驱动,工作正常,但是驱动不提供ESP8266的返回消息
main.cpp
- Committer:
- Yifan_Du
- Date:
- 2019-02-14
- Revision:
- 1:6df8ccaec251
- Parent:
- 0:1432a364e32a
File content as of revision 1:6df8ccaec251:
#include "mbed.h" #include "ThingSpeak_ESP8266.h" #define SSID "WIFI SSID" #define Password "WIFI PASSWORD" #define API_Key "YOUR API_KEY" Serial PC(USBTX, USBRX, 115200); ESP8266 WIFI(PC_10, PC_11, 115200); void WIFI_init(void); int main(void) { int data = 0; WIFI_init(); WIFI.User_API_Key = API_Key; while(1) { PC.printf("Send %2d", data); WIFI.Send_To_ThingSpeak_int(1, data); PC.printf(" Done\r\n"); data++; wait(5); } } void WIFI_init(void) { printf("\r\nReset ESP..."); WIFI.Reset(); printf("\r\nSet Mode..."); WIFI.Set_Mode(); printf("\r\nConnect WIFI...."); WIFI.Connect_WIFI(SSID, Password); }