diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/Schermafbeelding 2024-04-05 110142.png b/docs/LearningProcessBram/ArduinoExperience/classesArduino/Schermafbeelding 2024-04-05 110142.png new file mode 100644 index 0000000..7618781 Binary files /dev/null and b/docs/LearningProcessBram/ArduinoExperience/classesArduino/Schermafbeelding 2024-04-05 110142.png differ diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/Schermafbeelding 2024-04-05 110219.png b/docs/LearningProcessBram/ArduinoExperience/classesArduino/Schermafbeelding 2024-04-05 110219.png new file mode 100644 index 0000000..507b598 Binary files /dev/null and b/docs/LearningProcessBram/ArduinoExperience/classesArduino/Schermafbeelding 2024-04-05 110219.png differ diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/buttonClassOff.jpg b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buttonClassOff.jpg new file mode 100644 index 0000000..1aa6eb8 Binary files /dev/null and b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buttonClassOff.jpg differ diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/buttonClassOn.jpg b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buttonClassOn.jpg new file mode 100644 index 0000000..9de6712 Binary files /dev/null and b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buttonClassOn.jpg differ diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerClassDoc.md b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerClassDoc.md index a272d7c..a635ffb 100644 --- a/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerClassDoc.md +++ b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerClassDoc.md @@ -5,7 +5,7 @@ This class is intended to assign an input and output source for a button to acti This class code allows the user to easily add new buzzers by simply creating an object and calling the appropriate function. -##### constructor +##### Constructor Inside the class, a constructor is defined. In C++, this constructor shares the same name as the class itself. Every time the class is called, the constructor is activated with the given data. ##### Class functions @@ -18,10 +18,41 @@ After defining the class, an object needs to be made. This object will immediate In this instance, the buzzer pin is set to 12 and the button pin to 20. -##### using the class +##### Using the class In the loop function, the new object is placed along with the function defined in the class to activate it. This function executes with the variable data provided in the constructor. Here, it checks if the specified pin is receiving a signal and then only outputs a signal to the buzzer when there is one. ##### Link to code (https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/blob/main/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerclasses.ino?ref_type=heads) +### The board +The fysical board should look something like this: +![Fritzing of board]() +The board is simple and easy to recreate and has lots of space left for other functions. +By making this class, the addition of more buzzers is very easy. As long as there are pins, there can be a buzzer. + +For this example, I have only used one, but adding more would be no problem. Just make a object, give the pin numbers and call the function. + +The wireframe for this board would looke something like this: +![wireframe]() + +I tried making it as clear as possible by moving some parts around and clearing some intertwining wires. + +###### My Fysical Recreation. +To properly demonstrate this code in action, I recreated the board. In the image, you can see that I plugged in three different LEDs. +![fysical board](buttonClassOff.jpg) +In the image, you can see that I plugged in three different LEDs. +This was done to show off that the board/code works, as it's not possible to see if a buzzer is working on camera. + +For the time being, pretend that the LED and resistor combinations are separate buzzers. + +To make this board turn all the buzzers/LEDs on, I needed to create three different objects. These objects looked like this: +![threeObjects](threeObjects.png) +The first variable is where I want the buzzer to connect, and the second variable is where I want the button to be connected. + +After this, I simply placed the objects in the loop and called the function we made in the class: +![function calling](threeObjectsAndFunctions.png) + +Now, we simply push the code to The Esp and try it out. +![The classes work](buttonClassOn.jpg) +Now, we have effectively made the LEDs/buzzers turn on with the push of a single button. \ No newline at end of file diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/threeObjects.png b/docs/LearningProcessBram/ArduinoExperience/classesArduino/threeObjects.png new file mode 100644 index 0000000..9718bde Binary files /dev/null and b/docs/LearningProcessBram/ArduinoExperience/classesArduino/threeObjects.png differ diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/threeObjectsAndFunctions.png b/docs/LearningProcessBram/ArduinoExperience/classesArduino/threeObjectsAndFunctions.png new file mode 100644 index 0000000..27cf333 Binary files /dev/null and b/docs/LearningProcessBram/ArduinoExperience/classesArduino/threeObjectsAndFunctions.png differ