formatting
This commit is contained in:
@@ -26,25 +26,23 @@ void setup() {
|
|||||||
pinMode(6, OUTPUT);
|
pinMode(6, OUTPUT);
|
||||||
digitalWrite(6, HIGH);
|
digitalWrite(6, HIGH);
|
||||||
|
|
||||||
//print het hardware ID van de esp32S3
|
//print het hardware ID van de esp32S3
|
||||||
Serial.print("mac adress:");
|
Serial.print("mac adress:");
|
||||||
Serial.println(WiFi.macAddress());
|
Serial.println(WiFi.macAddress());
|
||||||
//verbinden met wifi
|
//verbinden met wifi
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
wifiMulti.addAP("ObsidianAmstelveen", "drijversstraatmaastricht");
|
wifiMulti.addAP("ObsidianAmstelveen", "drijversstraatmaastricht");
|
||||||
wifiMulti.addAP("iotroam", "BcgrFpX3kl");
|
wifiMulti.addAP("iotroam", "BcgrFpX3kl");
|
||||||
//een loop zodat het script wacht tot de esp32s3 verbind met het internet
|
//een loop zodat het script wacht tot de esp32s3 verbind met het internet
|
||||||
while (wifiMulti.run() != WL_CONNECTED) {
|
while (wifiMulti.run() != WL_CONNECTED) {
|
||||||
}
|
}
|
||||||
//print het ip adress van de esp32s3 naar de console
|
//print het ip adress van de esp32s3 naar de console
|
||||||
Serial.println(WiFi.localIP());
|
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);
|
|
||||||
|
|
||||||
|
|
||||||
|
//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() {
|
void loop() {
|
||||||
@@ -80,13 +78,9 @@ void loop() {
|
|||||||
//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
|
//print de response code naar
|
||||||
Serial.print("HTTP Response code:");
|
Serial.print("HTTP Response code:");
|
||||||
Serial.println(httpResponseCode);
|
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