The library is designed to connect the MBED boards to the ThingSpeak IoT cloud.

Fork of Thingspeak by Reza Mashayekhi

Thingspeak.cpp

Committer:
mreda
Date:
2018-02-12
Revision:
1:0c196a572d6b
Parent:
0:d98f92bb426f

File content as of revision 1:0c196a572d6b:

#include "mbed.h"
#include "Thingspeak.h"
      
HTTPResult Thingspeak::PostDataToChannel(char* channelWriteAPIKey, int fieldNumber, int fieldValue){
    char url[100];          
    sprintf( url, "https://api.thingspeak.com/update?api_key=%s&field%d=%d  ", channelWriteAPIKey, fieldNumber, fieldValue);   
    HTTPMap map;
    HTTPText text("", 1);
    map.put("", "");
    return _http.post(url, map, &text,1); 
}