Uploading sensor data (voltage divider, MAX4172, INA219) over Ethernet to Thing Speak service. Uses old mbed revision that is compatible with NetServices library. I2C communication is made with I2CR library.

Dependencies:   C12832 I2CR INA219 NetServices mbed

Fork of NetServices_HelloWorld by Segundo Equipo

ThingSpeak.h

Committer:
tsoic
Date:
2015-11-20
Revision:
6:ebbde59c5a1d
Child:
7:1da0a084cd69

File content as of revision 6:ebbde59c5a1d:

#ifndef THINGSPEAK_H
#define THINGSPEAK_H
#define HOSTNAME "mbed"
#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPClient.h"


class ThingSpeak {
    
    public:
    
        ThingSpeak(char*, const int);
        void connect();
        void getIP();
        void putUp();
        void setField(float, int);   
    private:
        
        char* thingSpeakUrl;
        char* thingSpeakKey;
        char urlBuffer[511];
        char fieldBuffer[255];  
        EthernetNetIf eth;
        EthernetErr ethErr;
        HTTPClient http; 
        IpAddr ethIp;
        HTTPText resp;
        HTTPResult res;  
};

#endif