Update 'DHT11toMYSQL.ino'
This commit is contained in:
@@ -39,10 +39,9 @@ void setup() {
|
|||||||
void loop(){
|
void loop(){
|
||||||
// 30sec measurement interval
|
// 30sec measurement interval
|
||||||
delay(30000);
|
delay(30000);
|
||||||
|
|
||||||
float h = dht.readHumidity();
|
float h = dht.readHumidity();
|
||||||
float t = dht.readTemperature();
|
float t = dht.readTemperature();
|
||||||
|
// Prepare measurement values as query string
|
||||||
String queryString = String("?humidity=") + String(h) + String("&temperature=") + String(t);
|
String queryString = String("?humidity=") + String(h) + String("&temperature=") + String(t);
|
||||||
|
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80)) {
|
||||||
@@ -58,7 +57,6 @@ client.println("Connection: close");
|
|||||||
client.println(); // end HTTP request header
|
client.println(); // end HTTP request header
|
||||||
//send HTTP body
|
//send HTTP body
|
||||||
client.println(queryString);
|
client.println(queryString);
|
||||||
|
|
||||||
while(client.available())
|
while(client.available())
|
||||||
{
|
{
|
||||||
// read an incoming byte from the server and print them to serial monitor:
|
// read an incoming byte from the server and print them to serial monitor:
|
||||||
|
|||||||
Reference in New Issue
Block a user