diff options
author | Alphara <42233094+xAlpharax@users.noreply.github.com> | 2023-11-04 22:09:05 +0000 |
---|---|---|
committer | Alphara <42233094+xAlpharax@users.noreply.github.com> | 2023-11-04 22:09:05 +0000 |
commit | 3661f79869849752d94f823524a291ef54444c70 (patch) | |
tree | b12b6e4e46ec1837c8ba40bd619761b24f77007d | |
parent | a26b7c2cff9ca416917872a976fbcce6202fb938 (diff) |
WiFi Pretty much works but breaks.
I'm late with this situation so I'll let the json parsing and the http handling for when wifi works without those interferences.
-rw-r--r-- | actual_board_code/actual_board_code.ino | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/actual_board_code/actual_board_code.ino b/actual_board_code/actual_board_code.ino index a080a9b..b95517c 100644 --- a/actual_board_code/actual_board_code.ino +++ b/actual_board_code/actual_board_code.ino @@ -5,6 +5,12 @@ #include "DHT.h" +// #include "WiFi.h" // working with wifi, might interfere with pins (or so it seemed) + +// #include "Arduino.h" +// #include "HTTPClient.h" // HTTP Handling +// #include "ArduinoJson.h" // JSON Handling + // CONFIGURATION // DHT PINS @@ -35,6 +41,12 @@ float ratio = 0; float concentration = 0; uint32_t delayMS = 1000; // in loop delay() explicited +// WiFI stuff + +const char* ssid = "Stefan's Galaxy A52s 5G"; +const char* password = "12345678"; +const char* apiEndpoint = ""; + // Initialize DHT Sensor. The current DHT reading algorithm adjusts itself to work on faster procs. (rtfm --> docs) DHT dht(DHTPIN, DHTTYPE); @@ -43,6 +55,13 @@ DHT dht(DHTPIN, DHTTYPE); void setup() { // Setup code that gets run regardless Serial.begin(9600); + // WiFi.begin(ssid, password); // WiFi configuration at startup + // while (WiFi.status() != WL_CONNECTED) { + // delay(1000); + // Serial.println("Connecting to WiFi..."); + // } + // Serial.println("Connected to WiFi"); + Serial.println(F("----- DHT + MQ + DSM Interface -----")); dht.begin(); // Begin DHT System at startup @@ -92,8 +111,7 @@ void loop() { // Main code // vvv MQ135 MEASUREMENTS SECTION vvv // Serial.println(analogRead(15)); // MQ135 Sensor - ppm metrics (raw) - Serial.println("ppm") - + Serial.println(F("^ppm^")); // vvv DSM501A MEASUREMENTS SECTION vvv // duration = pulseIn(DSM501, LOW); |