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.
|
||||
//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>
|
||||
@@ -54,16 +57,9 @@ void loop() {
|
||||
float Lichtsterkte = analogRead(LDR);
|
||||
|
||||
//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);
|
||||
//stuur de post request naar de server toe
|
||||
int httpResponseCode = http.POST(httpRequestData);
|
||||
//print de response code naar
|
||||
Serial.print("HTTP Response code:");
|
||||
Serial.println(httpResponseCode);
|
||||
//wacht x aanal miliseconden
|
||||
digitalWrite(5, HIGH);
|
||||
delay(400);
|
||||
|
Reference in New Issue
Block a user