formatting
This commit is contained in:
@@ -26,25 +26,23 @@ void setup() {
|
||||
pinMode(6, OUTPUT);
|
||||
digitalWrite(6, HIGH);
|
||||
|
||||
//print het hardware ID van de esp32S3
|
||||
Serial.print("mac adress:");
|
||||
Serial.println(WiFi.macAddress());
|
||||
//verbinden met wifi
|
||||
WiFi.mode(WIFI_STA);
|
||||
wifiMulti.addAP("ObsidianAmstelveen", "drijversstraatmaastricht");
|
||||
wifiMulti.addAP("iotroam", "BcgrFpX3kl");
|
||||
//een loop zodat het script wacht tot de esp32s3 verbind met het internet
|
||||
while (wifiMulti.run() != WL_CONNECTED) {
|
||||
}
|
||||
//print het hardware ID van de esp32S3
|
||||
Serial.print("mac adress:");
|
||||
Serial.println(WiFi.macAddress());
|
||||
//verbinden met wifi
|
||||
WiFi.mode(WIFI_STA);
|
||||
wifiMulti.addAP("ObsidianAmstelveen", "drijversstraatmaastricht");
|
||||
wifiMulti.addAP("iotroam", "BcgrFpX3kl");
|
||||
//een loop zodat het script wacht tot de esp32s3 verbind met het internet
|
||||
while (wifiMulti.run() != WL_CONNECTED) {
|
||||
}
|
||||
//print het ip adress van de esp32s3 naar de console
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
//gebruikt deze website om posts requests naar toe te sturen
|
||||
http.begin("http://hva-onto.nl/api/ti/map/measurements/add?api-key=efffc47610ea6282a3416f71b51b3a");
|
||||
//lampje aan om aan te geven dat esp32S3 is verbonden met internet
|
||||
digitalWrite(4, HIGH);
|
||||
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
//gebruikt deze website om posts requests naar toe te sturen
|
||||
http.begin("http://hva-onto.nl/api/ti/map/measurements/add?api-key=efffc47610ea6282a3416f71b51b3a");
|
||||
//lampje aan om aan te geven dat esp32S3 is verbonden met internet
|
||||
digitalWrite(4, HIGH);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
@@ -80,13 +78,9 @@ void loop() {
|
||||
//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
|
||||
Serial.print("HTTP Response code:");
|
||||
Serial.println(httpResponseCode);
|
||||
//wacht x aanal miliseconden
|
||||
digitalWrite(5, HIGH);
|
||||
delay(400);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user