Voici mon programme en antier j'arrive pas a le compiler a cause de l'erreur : stray '\303' in program
#include <WiFi.h>
#include <HTTPClient.h>
#include <DHT.h>
#define DHTPIN 19 //D19
DHT dht11(DHTPIN,DHTTYPE)
String URL = "http://172.20.10.3/dht11/data.php";
const char* ssid = "iphone de PC";
const char* password = "azerty000";
int temperature = 50 ;
int humidité = 50;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
dht11.begin();
connectWiFi();
}
void loop() {
// put your main code here, to run repeatedly:
if (WiFi.status() !=WL_CONNECTED) {
connectWiFi();
}
load_DHT11_data();
String postData = "temperature=" + String(temperature) + "&humidité" = + String(humidité);
http.Client http;
http.begin(URL);
int httpCode = http.POST(postData);
String payload = http.getSring();
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
Serial.print("URL: "); Serial.println(URL);
Serial.print("data: "); Serial.println(postdata);
Serial.print("httpCode: "); Serial.println(httpCode);
Serial.print("payload: "); Serial.println(payload);
Serial.println("-------------------------------------");
delay(5000);
}
void load_DHT11_Data() {
temperature = dht11.readTemperature();
humidité = dht11.readHumidity();
if (isnan(temperature) && isnan(humidité)){
Serial.println("failed to read from dht11");
temperature = 0;
humidité = 0;
}
Serial.printf("Temperature: %d °C\n", temperature);
Serial.printf("Humidité: %d %\n", humidité);
}
void connectedWiFi() {
delay (1000);
WiFi.mode(WIFI_STA);
}