From f94c452a19a28fbc7dec4afe78fcad5b9a5b6a0e Mon Sep 17 00:00:00 2001 From: Dano van den Bosch Date: Thu, 21 Mar 2024 11:31:03 +0100 Subject: [PATCH 01/11] added comments --- arduino/node-code/nodeCodeFinal/nodeCodeFinal.ino | 2 -- arduino/node-code/nodeCodeFinal/nodeCodeHeader.cpp | 12 +++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arduino/node-code/nodeCodeFinal/nodeCodeFinal.ino b/arduino/node-code/nodeCodeFinal/nodeCodeFinal.ino index d984954..acb3434 100644 --- a/arduino/node-code/nodeCodeFinal/nodeCodeFinal.ino +++ b/arduino/node-code/nodeCodeFinal/nodeCodeFinal.ino @@ -4,12 +4,10 @@ nodeReadings esp32Node; void setup() { - // put your setup code here, to run once: esp32Node.setup(); esp32Node.resetValues(); } void loop() { - // put your main code here, to run repeatedly: esp32Node.loop(); } diff --git a/arduino/node-code/nodeCodeFinal/nodeCodeHeader.cpp b/arduino/node-code/nodeCodeFinal/nodeCodeHeader.cpp index cac49f7..e69dd42 100644 --- a/arduino/node-code/nodeCodeFinal/nodeCodeHeader.cpp +++ b/arduino/node-code/nodeCodeFinal/nodeCodeHeader.cpp @@ -2,16 +2,19 @@ nodeReadings::nodeReadings() { + //Making all the new object as defined in the .h file dht = new DHT(DHTPIN, DHTTYPE); display = new Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); - webSocket = new websockets(); //nu naar eigen class + webSocket = new websockets(); sgp = new Adafruit_SGP30(); + //setting the reding for every 5 sec interval = 5000; resetValues(); } +//Script for simpley reseting every value to 0 void nodeReadings::resetValues() { counter = 0; eCO2 = 0; @@ -25,6 +28,7 @@ void nodeReadings::resetValues() { noise = false; } +//Setup for initilising the dht and sgp sensors. Also the display is set up. void nodeReadings::setup(){ // make serial connection at 115200 baud Serial.begin(115200); @@ -63,6 +67,7 @@ void nodeReadings::update(){ // display sensordata on oled screen displayData(); + //send the data to the websockets webSocket->sendMyText("{\"node\": \"" + String(WiFi.macAddress()) + "\", \"Temp\":\"" + String(temperature) + "\",\"Humi\":\"" + String(humidity) + "\",\"eCO2\":\"" + String(sgp->eCO2) + "\",\"TVOC\":\"" + String(sgp->TVOC) + "\"}"); sgp->getIAQBaseline(&eCO2_base, &TVOC_base); @@ -83,13 +88,14 @@ void nodeReadings::displayData() { display->setTextSize(2); display->setTextColor(SH110X_WHITE); display->setCursor(0,0); - display->println("Temp: " + String(int(temperature)) + " C"); - display->println("Humi: " + String(int(humidity)) + " %"); + display->println("Temp: " + String(int(temperature)) + "C"); + display->println("Humi: " + String(int(humidity)) + "%"); display->println("eCO2: " + String(sgp->eCO2));// + " ppm"); display->println("TVOC: " + String(sgp->TVOC));// + " ppb"); display->display(); } +//function void nodeReadings::checkForError(){ if (!sgp->IAQmeasure()) { Serial.println("SGP30: BAD"); From 1982db8c50f7f4c195cc9980947bb6194b86a661 Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Fri, 22 Mar 2024 11:30:04 +0100 Subject: [PATCH 02/11] Add node class and update liveGraph class --- web/classes.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/web/classes.js b/web/classes.js index 2067bfc..49fae13 100644 --- a/web/classes.js +++ b/web/classes.js @@ -1,3 +1,26 @@ +class node { + // Constructor to initialize the node + constructor(nodeId) { + this.nodeId = nodeId; + this.temperature = 0; + this.humidity = 0; + this.eCO2 = 0; + this.TVOC = 0; + this.connected = false; + } + // Function to update the data + updateData(temperature, humidity, eCO2, TVOC) { + this.temperature = temperature; + this.humidity = humidity; + this.eCO2 = eCO2; + this.TVOC = TVOC; + } + // Function to update the connection status + updateConnection(status) { + this.connected = status; + } +} + class liveGraph { // Constructor to initialize the graph constructor(id) { From 07cc13d573c35096359abae7220ecbab02c2812a Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Fri, 22 Mar 2024 12:31:53 +0100 Subject: [PATCH 03/11] Refactor classes.js to update connection status and add feedbackNode and graph classes --- web/classes.js | 72 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/web/classes.js b/web/classes.js index 49fae13..1837cef 100644 --- a/web/classes.js +++ b/web/classes.js @@ -16,12 +16,30 @@ class node { this.TVOC = TVOC; } // Function to update the connection status - updateConnection(status) { - this.connected = status; + updateConnection() { + if (connectedNodes[this.nodeId]) { + this.connected = true; + } + else { + this.connected = false; + } } } -class liveGraph { +class feedbackNode extends node { + // Constructor to initialize the feedback node + constructor(nodeId) { + super(nodeId); + this.feedback = {}; + this.answers = 0; + } + // Function to update the feedback + updateFeedback(feedback) { + this.feedback = feedback; + } +} + +class liveGraph extends node{ // Constructor to initialize the graph constructor(id) { this.timeArray = []; @@ -105,4 +123,52 @@ class liveGraph { this.eco2Array.push(eCO2 / 10); this.tvocArray.push(TVOC / 10); } +} + +class graph { + // Constructor to initialize the graph + constructor(id) { + this.timeArray = []; + this.tempArray = []; + this.humiArray = []; + this.eco2Array = []; + this.tvocArray = []; + this.nodeId = "graph" + id; + } + // Function to create a graph + makeGraph(amountOfGraphs) { + for (let i = 0; i < amountOfGraphs; i++) { + + // Create a new line for temperature + Plotly.plot(this.nodeId, [ + { + x: this.timeArray, // Use timeArray as x values + y: this.array[i], + mode: "lines", + line: { color: "#FF0000" }, + name: "Temperature", + }, + ]); + } + } + // Function to update the graph with new values got from updateData function + updateGraph() { + let time = new Date(); + this.timeArray.push(new Date()); + + let update = { + x: [[this.timeArray]], + y: [[this.tempArray], [this.humiArray], [this.eco2Array], [this.tvocArray]] + }; + + let olderTime = time.setMinutes(time.getMinutes() - 1); + let futureTime = time.setMinutes(time.getMinutes() + 1); + let minuteView = { + xaxis: { + type: "date", + range: + }, + }; + +} } \ No newline at end of file From ca5d92bd86637a362c26fe19bb0ef4d11297cd2c Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Fri, 22 Mar 2024 12:38:39 +0100 Subject: [PATCH 04/11] Refactor graph class constructor and methods --- web/classes.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/web/classes.js b/web/classes.js index 1837cef..0c9f96a 100644 --- a/web/classes.js +++ b/web/classes.js @@ -42,13 +42,13 @@ class feedbackNode extends node { class liveGraph extends node{ // Constructor to initialize the graph constructor(id) { + super(id, live); this.timeArray = []; this.tempArray = []; this.humiArray = []; this.eco2Array = []; this.tvocArray = []; this.cnt = 0; - this.nodeId = "liveGraph" + id; } // Fuction to create a graph makeGraph() { @@ -127,23 +127,23 @@ class liveGraph extends node{ class graph { // Constructor to initialize the graph - constructor(id) { - this.timeArray = []; - this.tempArray = []; - this.humiArray = []; - this.eco2Array = []; - this.tvocArray = []; + constructor(id, graph) { + if (graph === "live") { + this.nodeId = "liveGraph" + id; + } + else { this.nodeId = "graph" + id; + } } // Function to create a graph - makeGraph(amountOfGraphs) { + makeGraph(amountOfGraphs, array1, array2, array3, array4) { for (let i = 0; i < amountOfGraphs; i++) { // Create a new line for temperature Plotly.plot(this.nodeId, [ { x: this.timeArray, // Use timeArray as x values - y: this.array[i], + y: array + i, mode: "lines", line: { color: "#FF0000" }, name: "Temperature", @@ -152,13 +152,13 @@ class graph { } } // Function to update the graph with new values got from updateData function - updateGraph() { + updateGraph(array1, array2, array3, array4) { let time = new Date(); this.timeArray.push(new Date()); let update = { x: [[this.timeArray]], - y: [[this.tempArray], [this.humiArray], [this.eco2Array], [this.tvocArray]] + y: [array1, array2, array3, array4] }; let olderTime = time.setMinutes(time.getMinutes() - 1); From e5511d192527239aba71b04ada33c1c80f4e20fd Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Fri, 22 Mar 2024 12:45:31 +0100 Subject: [PATCH 05/11] Add node and graph classes for data visualization --- .../SoftwareDocumentatie/graph_classes.md | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/docs/brainstorm/SoftwareDocumentatie/graph_classes.md b/docs/brainstorm/SoftwareDocumentatie/graph_classes.md index 5df185e..0acf0e1 100644 --- a/docs/brainstorm/SoftwareDocumentatie/graph_classes.md +++ b/docs/brainstorm/SoftwareDocumentatie/graph_classes.md @@ -1,3 +1,55 @@ +# Nodes + +## Introduction + +The nodes are the devices that are placed in the rooms. The nodes are used to collect the data from the sensors. Every node is connected to the websocket, and sends their data with their mac address in json format. The websocket broadcasts the node data back to all clients, and since our website functions as a client it also receives the data. Every node will, depending on what node, be made into a class. + +## Requirements + +### Sensornode + +- Every node has to have a unique nodeID +- Every node has to have their corresponding sensorsvalues in form of arrays + +### Feedbacknodes + +- Every node has to have a unique nodeID +- Every node has to have their corresponding feedback in form of a 2D array + +## Class diagrams + +### Node + +```mermaid +classDiagram + class Node { + +nodeID + +processNodeData() + +updateNodeData() + } +``` + +#### Sensornode + +```mermaid +classDiagram + class SensorNode extends Node { + +tempArray + +humiArray + +eco2Array + +tvocArray + } +``` + +#### Feedbacknode + +```mermaid +classDiagram + class FeedbackNode extends Node { + +feedbackArray + } +``` + # Graphs ## Introduction @@ -14,12 +66,21 @@ The graphs are used to display the data from the sensors. The data is collected ## Class diagrams +### Graphs + +```mermaid +classDiagram + class graph { + +nodeId + makeGraph() + } +``` + ### Live graphs ```mermaid classDiagram - class liveGraph { - +nodeId + class liveGraph extends graph { +cnt +timeArray +tempArray From 2221be88bfd81301793f1d949cbe70b81bdb2ea3 Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Fri, 22 Mar 2024 14:44:25 +0100 Subject: [PATCH 06/11] Refactor class constructors and update graph creation --- web/classes.js | 56 ++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/web/classes.js b/web/classes.js index 0c9f96a..50e0e26 100644 --- a/web/classes.js +++ b/web/classes.js @@ -19,8 +19,7 @@ class node { updateConnection() { if (connectedNodes[this.nodeId]) { this.connected = true; - } - else { + } else { this.connected = false; } } @@ -31,7 +30,7 @@ class feedbackNode extends node { constructor(nodeId) { super(nodeId); this.feedback = {}; - this.answers = 0; + this.answers = 0; } // Function to update the feedback updateFeedback(feedback) { @@ -39,16 +38,16 @@ class feedbackNode extends node { } } -class liveGraph extends node{ +class liveGraph extends node { // Constructor to initialize the graph constructor(id) { - super(id, live); - this.timeArray = []; + super(id); this.tempArray = []; this.humiArray = []; this.eco2Array = []; this.tvocArray = []; this.cnt = 0; + this.nodeId = "liveGraph" + id; } // Fuction to create a graph makeGraph() { @@ -101,7 +100,12 @@ class liveGraph extends node{ let update = { x: [[this.timeArray]], - y: [[this.tempArray], [this.humiArray], [this.eco2Array], [this.tvocArray]] + y: [ + [this.tempArray], + [this.humiArray], + [this.eco2Array], + [this.tvocArray], + ], }; let olderTime = time.setMinutes(time.getMinutes() - 1); @@ -127,28 +131,23 @@ class liveGraph extends node{ class graph { // Constructor to initialize the graph - constructor(id, graph) { - if (graph === "live") { - this.nodeId = "liveGraph" + id; - } - else { - this.nodeId = "graph" + id; - } + constructor(id) { + this.nodeId = "graph" + id; + this.timeArray = []; } // Function to create a graph makeGraph(amountOfGraphs, array1, array2, array3, array4) { for (let i = 0; i < amountOfGraphs; i++) { - - // Create a new line for temperature - Plotly.plot(this.nodeId, [ - { - x: this.timeArray, // Use timeArray as x values - y: array + i, - mode: "lines", - line: { color: "#FF0000" }, - name: "Temperature", - }, - ]); + // Create a new line for temperature + Plotly.plot(this.nodeId, [ + { + x: this.timeArray, // Use timeArray as x values + y: array + i, + mode: "lines", + line: { color: "#FF0000" }, + name: "Temperature", + }, + ]); } } // Function to update the graph with new values got from updateData function @@ -158,7 +157,7 @@ class graph { let update = { x: [[this.timeArray]], - y: [array1, array2, array3, array4] + y: [array1, array2, array3, array4], }; let olderTime = time.setMinutes(time.getMinutes() - 1); @@ -166,9 +165,8 @@ class graph { let minuteView = { xaxis: { type: "date", - range: + range: [olderTime, futureTime], }, }; - + } } -} \ No newline at end of file From 1182e89c56d0610853a91f9006bb5c9de353a2df Mon Sep 17 00:00:00 2001 From: Dano van den Bosch Date: Sat, 23 Mar 2024 11:39:25 +0100 Subject: [PATCH 07/11] Node documetnation --- docs/node-documentation/nodeClass.md | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 docs/node-documentation/nodeClass.md diff --git a/docs/node-documentation/nodeClass.md b/docs/node-documentation/nodeClass.md new file mode 100644 index 0000000..fb9b4ed --- /dev/null +++ b/docs/node-documentation/nodeClass.md @@ -0,0 +1,59 @@ +# OOP within Arduino + +### Why use classes + +## Whitch classes did we use + +### Uml diagram + +--- +title: Arduino classes +--- +classDiagram + class Websockets + Websockets: + + +Class Websockets: + Public: + websockets(); + void hexdump(const void *mem, uint32_t len, uint8_t cols = 16); + void websocketSetup(); + void loop(); + void webSocketEvent(WStype_t type, uint8_t * payload, size_t length); + void sendMyText(String message); + + private: + WebSocketsClient *webSocket; + WiFiMulti *_WiFiMulti; + +Class NodeReadings: +public: + nodeReadings(); + void setup(); + void loop(); + void resetValues(); + void update(); + void checkForError(); + void displayData(); + +private: + DHT *dht; + Adafruit_SH1106G *display; + websockets *webSocket; + Adafruit_SGP30 *sgp; + + uint16_t TVOC_base, eCO2_base; + uint16_t counter; + uint16_t eCO2; + uint16_t TVOC; + uint16_t interval; + float temperature; + float humidity; + unsigned long currentMillis; + unsigned long lastMillis; + bool errorSGP30; + bool errorDHT11; + bool noise; + +### Small explenation \ No newline at end of file From 12909d365089313c468d2d1bac50464a52a0cf7e Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Tue, 26 Mar 2024 11:01:16 +0100 Subject: [PATCH 08/11] Add Node and Graph classes for website functionality --- .../{graph_classes.md => classes-website.md} | 43 ++++++++++--------- web/classes.js | 2 +- 2 files changed, 24 insertions(+), 21 deletions(-) rename docs/brainstorm/SoftwareDocumentatie/{graph_classes.md => classes-website.md} (82%) diff --git a/docs/brainstorm/SoftwareDocumentatie/graph_classes.md b/docs/brainstorm/SoftwareDocumentatie/classes-website.md similarity index 82% rename from docs/brainstorm/SoftwareDocumentatie/graph_classes.md rename to docs/brainstorm/SoftwareDocumentatie/classes-website.md index 0acf0e1..9da4e19 100644 --- a/docs/brainstorm/SoftwareDocumentatie/graph_classes.md +++ b/docs/brainstorm/SoftwareDocumentatie/classes-website.md @@ -22,30 +22,24 @@ The nodes are the devices that are placed in the rooms. The nodes are used to co ```mermaid classDiagram + + Node <-- SensorNode : extends + Node <-- FeedbackNode : extends + class Node { +nodeID +processNodeData() +updateNodeData() } -``` -#### Sensornode - -```mermaid -classDiagram - class SensorNode extends Node { + class SensorNode { +tempArray +humiArray +eco2Array +tvocArray } -``` -#### Feedbacknode - -```mermaid -classDiagram - class FeedbackNode extends Node { + class FeedbackNode { +feedbackArray } ``` @@ -68,19 +62,16 @@ The graphs are used to display the data from the sensors. The data is collected ### Graphs -```mermaid +```mermaid classDiagram + + liveGraph --> graph: extends class graph { +nodeId makeGraph() } -``` -### Live graphs - -```mermaid -classDiagram - class liveGraph extends graph { + class liveGraph { +cnt +timeArray +tempArray @@ -91,8 +82,8 @@ classDiagram updateGraph() updateData() } -``` +``` ## Order of operations ### Live graphs @@ -114,4 +105,16 @@ sequenceDiagram 3. The website updates the data coming from the raspberry pi on its own variables and arrays 4. The website updates the live graphs every time new data is received from the websocket +### Node +```mermaid +sequenceDiagram + participant Node + participant Raspberry pi + participant Website + + Node->>Raspberry pi: node data via websocket every 5 seconds + Raspberry pi->>Website: Make a new object depending on what node it is + Website->>Website: updateNodeData() + Website->>Website: processNodeData() +``` diff --git a/web/classes.js b/web/classes.js index 50e0e26..9ce53a8 100644 --- a/web/classes.js +++ b/web/classes.js @@ -38,7 +38,7 @@ class feedbackNode extends node { } } -class liveGraph extends node { +class liveGraph extends graph { // Constructor to initialize the graph constructor(id) { super(id); From 62124ec40283052b9718b7e828734f04315e04ec Mon Sep 17 00:00:00 2001 From: Dano van den Bosch Date: Tue, 26 Mar 2024 13:41:16 +0100 Subject: [PATCH 09/11] added kopjes --- docs/node-documentation/nodeClass.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/node-documentation/nodeClass.md b/docs/node-documentation/nodeClass.md index fb9b4ed..02723d4 100644 --- a/docs/node-documentation/nodeClass.md +++ b/docs/node-documentation/nodeClass.md @@ -2,6 +2,16 @@ ### Why use classes + + +### Abstraction + +### Encaptiolation + +### Inheritance + +### Polymorphism + ## Whitch classes did we use ### Uml diagram From 9fc5c5b53b1994dedf525fddeeb51363d559e3df Mon Sep 17 00:00:00 2001 From: Dano van den Bosch Date: Wed, 27 Mar 2024 12:13:59 +0100 Subject: [PATCH 10/11] Arduino OOP documentation --- .../NodeClassDocumentation.md | 20 ++++++ docs/node-documentation/nodeClass.md | 69 ------------------- docs/node-documentation/nodeClassUml.md | 43 ++++++++++++ 3 files changed, 63 insertions(+), 69 deletions(-) create mode 100644 docs/node-documentation/NodeClassDocumentation.md delete mode 100644 docs/node-documentation/nodeClass.md create mode 100644 docs/node-documentation/nodeClassUml.md diff --git a/docs/node-documentation/NodeClassDocumentation.md b/docs/node-documentation/NodeClassDocumentation.md new file mode 100644 index 0000000..d0bc370 --- /dev/null +++ b/docs/node-documentation/NodeClassDocumentation.md @@ -0,0 +1,20 @@ +# OOP within Arduino + +Object-Oriented Programming (OOP) is a way of programing that provides a means of structuring your code so the code is modular and can be used more often without making huge changes or having to copy past the same code. + +## Abstraction + +Abstraction in OOP is the process of exposing only the required essential variables and functions. This means hiding the complexity and only showing the essential features of the object. In Arduino, this could mean creating a class like `Sensor node` with methods such as `setUp()`, `displayData()`, and `checkForError()`. + +## Encapsulation + +Encapsulation is the technique used to hide the data and methods within an object and prevent outside access. In Arduino, this could mean having private variables and methods in a class that can only be accessed and modified through public methods. + +## Which classes did we use + +In this Arduino project, we used several classes to organize our code and manage the complexity of the project. Some of these classes include: + +- `websockets`: This class is responsible for managing the WebSocket connections. +- `nodeReadings`: This class is responsible for managing the sensor readings. + +Each of these classes encapsulates the data and methods related to a specific part of the project, making the code easier to understand and maintain. \ No newline at end of file diff --git a/docs/node-documentation/nodeClass.md b/docs/node-documentation/nodeClass.md deleted file mode 100644 index 02723d4..0000000 --- a/docs/node-documentation/nodeClass.md +++ /dev/null @@ -1,69 +0,0 @@ -# OOP within Arduino - -### Why use classes - - - -### Abstraction - -### Encaptiolation - -### Inheritance - -### Polymorphism - -## Whitch classes did we use - -### Uml diagram - ---- -title: Arduino classes ---- -classDiagram - class Websockets - Websockets: - - -Class Websockets: - Public: - websockets(); - void hexdump(const void *mem, uint32_t len, uint8_t cols = 16); - void websocketSetup(); - void loop(); - void webSocketEvent(WStype_t type, uint8_t * payload, size_t length); - void sendMyText(String message); - - private: - WebSocketsClient *webSocket; - WiFiMulti *_WiFiMulti; - -Class NodeReadings: -public: - nodeReadings(); - void setup(); - void loop(); - void resetValues(); - void update(); - void checkForError(); - void displayData(); - -private: - DHT *dht; - Adafruit_SH1106G *display; - websockets *webSocket; - Adafruit_SGP30 *sgp; - - uint16_t TVOC_base, eCO2_base; - uint16_t counter; - uint16_t eCO2; - uint16_t TVOC; - uint16_t interval; - float temperature; - float humidity; - unsigned long currentMillis; - unsigned long lastMillis; - bool errorSGP30; - bool errorDHT11; - bool noise; - -### Small explenation \ No newline at end of file diff --git a/docs/node-documentation/nodeClassUml.md b/docs/node-documentation/nodeClassUml.md new file mode 100644 index 0000000..2259384 --- /dev/null +++ b/docs/node-documentation/nodeClassUml.md @@ -0,0 +1,43 @@ +### Uml diagram: + +``` mermaid +classDiagram + +namespace Esp { + class Websockets{ + +webSocket + +_WiFiMulti + hexdump() + websocketSetup() + loop() + webSocketEvent() + sendMyText() + } + + class NodeReadings{ + + +TVOC_base, eCO2_base + +counter + +eCO2 + +TVOC + +interval + +temperature + +humidity + +currentMillis + +lastMillis + +errorSGP30 + +errorDHT11 + +noise + + setup() + loop() + resetValues() + update() + checkForError() + displayData() + + } + + +} +``` From 1ac6f0133179279ccceea111e34ea00ca06f7e98 Mon Sep 17 00:00:00 2001 From: Dano van den Bosch Date: Wed, 27 Mar 2024 12:18:55 +0100 Subject: [PATCH 11/11] replact to main --- .../NodeClassDocumentation.md | 20 --------- docs/node-documentation/nodeClassUml.md | 43 ------------------- 2 files changed, 63 deletions(-) delete mode 100644 docs/node-documentation/NodeClassDocumentation.md delete mode 100644 docs/node-documentation/nodeClassUml.md diff --git a/docs/node-documentation/NodeClassDocumentation.md b/docs/node-documentation/NodeClassDocumentation.md deleted file mode 100644 index d0bc370..0000000 --- a/docs/node-documentation/NodeClassDocumentation.md +++ /dev/null @@ -1,20 +0,0 @@ -# OOP within Arduino - -Object-Oriented Programming (OOP) is a way of programing that provides a means of structuring your code so the code is modular and can be used more often without making huge changes or having to copy past the same code. - -## Abstraction - -Abstraction in OOP is the process of exposing only the required essential variables and functions. This means hiding the complexity and only showing the essential features of the object. In Arduino, this could mean creating a class like `Sensor node` with methods such as `setUp()`, `displayData()`, and `checkForError()`. - -## Encapsulation - -Encapsulation is the technique used to hide the data and methods within an object and prevent outside access. In Arduino, this could mean having private variables and methods in a class that can only be accessed and modified through public methods. - -## Which classes did we use - -In this Arduino project, we used several classes to organize our code and manage the complexity of the project. Some of these classes include: - -- `websockets`: This class is responsible for managing the WebSocket connections. -- `nodeReadings`: This class is responsible for managing the sensor readings. - -Each of these classes encapsulates the data and methods related to a specific part of the project, making the code easier to understand and maintain. \ No newline at end of file diff --git a/docs/node-documentation/nodeClassUml.md b/docs/node-documentation/nodeClassUml.md deleted file mode 100644 index 2259384..0000000 --- a/docs/node-documentation/nodeClassUml.md +++ /dev/null @@ -1,43 +0,0 @@ -### Uml diagram: - -``` mermaid -classDiagram - -namespace Esp { - class Websockets{ - +webSocket - +_WiFiMulti - hexdump() - websocketSetup() - loop() - webSocketEvent() - sendMyText() - } - - class NodeReadings{ - - +TVOC_base, eCO2_base - +counter - +eCO2 - +TVOC - +interval - +temperature - +humidity - +currentMillis - +lastMillis - +errorSGP30 - +errorDHT11 - +noise - - setup() - loop() - resetValues() - update() - checkForError() - displayData() - - } - - -} -```