Quantcast
Channel: ThingSpeak IoT Community - Forum: Arduino
Viewing all articles
Browse latest Browse all 172

sushma on updating multiple fields to thingspeak

$
0
0

Hans said

What does your command look like?

thank you.

the code is,

// This sketch uses a DHT11 sensor to report temperature, humidity and dew point data to http://www.thingspeak.com.
//
// Sketch tested with an Arduino Uno, a HanRun Ethernet shield and a DHT11 temperature and humidity sensor.
//
// See http://playground.arduino.cc/main/DHT11Lib for the origins of the temperature, humidity and dew point functions.

#include
#include
#include

// ThingSpeak Settings
char thingSpeakAddress[] = "api.thingspeak.com";
String writeAPIKey = "99E4E2IDC9Y8J59B"; // Add your Thingspeak API key here

EthernetClient client;

// Temperature sensor settings
dht DHT;
#define DHTPIN 6

const int ONE_MINUTE = 60 * 1000;

int status;
int failedConnectionAttempCounter;

//Rounds down (via intermediary integer conversion truncation)
//See : http://lordvon64.blogspot.co.uk/2012/01/simple-arduino-double-to-string.html
String dblToString(double input, int decimalPlaces)
{
if( decimalPlaces != 0)
{
String string = String((int)(input*pow(10,decimalPlaces)));

if(abs(input) 0)
{
string = "0" + string;
}
else if(input 3 )
{
Serial.println("Re-starting the ethernet connection...");
connectToInternet();
failedConnectionAttempCounter = 0;
}
}
}


Viewing all articles
Browse latest Browse all 172

Trending Articles