added json library
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
#include <ArduinoJson.h>
|
||||||
|
#include <ArduinoJson.hpp>
|
||||||
|
|
||||||
//de library van de tempratuur en vochtisheid sensor er bij pakken.
|
//de library van de tempratuur en vochtisheid sensor er bij pakken.
|
||||||
//moet je instaleren via linker tabje moet boeken en dan dht11 op te zoeke n in het zoek veld en daarna de dht11 extensie te installeren
|
//moet je instaleren via linker tabje moet boeken en dan dht11 op te zoeke n in het zoek veld en daarna de dht11 extensie te installeren
|
||||||
#include <DHT11.h>
|
#include <DHT11.h>
|
||||||
@@ -54,17 +57,10 @@ void loop() {
|
|||||||
float Lichtsterkte = analogRead(LDR);
|
float Lichtsterkte = analogRead(LDR);
|
||||||
|
|
||||||
//hier worden alle variabelen in de serial monitor uitgespuugt, en websites kunnen ook de Serial.print lezen.
|
//hier worden alle variabelen in de serial monitor uitgespuugt, en websites kunnen ook de Serial.print lezen.
|
||||||
Serial.println("----------");
|
String JsArray = String("[") + Temparatuur + "," + Luchtvochtigheid + "," + Lichtsterkte +"]/n";
|
||||||
|
|
||||||
Serial.print("Temparatuur celcius: ");
|
|
||||||
Serial.println(Temparatuur);
|
|
||||||
|
|
||||||
Serial.print("vochtigheid: ");
|
|
||||||
Serial.println(Luchtvochtigheid);
|
|
||||||
|
|
||||||
Serial.print("LDR reading: ");
|
|
||||||
Serial.println(Lichtsterkte);
|
|
||||||
|
|
||||||
|
Serial.print(JsArray);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -75,9 +71,6 @@ void loop() {
|
|||||||
String httpRequestData = "type=temperature&value=" + String(Temparatuur);
|
String httpRequestData = "type=temperature&value=" + String(Temparatuur);
|
||||||
//stuur de post request naar de server toe
|
//stuur de post request naar de server toe
|
||||||
int httpResponseCode = http.POST(httpRequestData);
|
int httpResponseCode = http.POST(httpRequestData);
|
||||||
//print de response code naar
|
|
||||||
Serial.print("HTTP Response code:");
|
|
||||||
Serial.println(httpResponseCode);
|
|
||||||
//wacht x aanal miliseconden
|
//wacht x aanal miliseconden
|
||||||
digitalWrite(5, HIGH);
|
digitalWrite(5, HIGH);
|
||||||
delay(400);
|
delay(400);
|
||||||
|
Reference in New Issue
Block a user