diff --git a/docs/LearningProcessBram/ArduinoExperience/NodeWithWebConnection.ino b/docs/LearningProcessBram/ArduinoExperience/Webconnection/NodeWithWebConnection.ino similarity index 100% rename from docs/LearningProcessBram/ArduinoExperience/NodeWithWebConnection.ino rename to docs/LearningProcessBram/ArduinoExperience/Webconnection/NodeWithWebConnection.ino diff --git a/docs/LearningProcessBram/ArduinoExperience/NodeWithWebConnection.md b/docs/LearningProcessBram/ArduinoExperience/Webconnection/NodeWithWebConnection.md similarity index 100% rename from docs/LearningProcessBram/ArduinoExperience/NodeWithWebConnection.md rename to docs/LearningProcessBram/ArduinoExperience/Webconnection/NodeWithWebConnection.md diff --git a/docs/LearningProcessBram/ArduinoExperience/image.png b/docs/LearningProcessBram/ArduinoExperience/Webconnection/image.png similarity index 100% rename from docs/LearningProcessBram/ArduinoExperience/image.png rename to docs/LearningProcessBram/ArduinoExperience/Webconnection/image.png diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerClassDoc.md b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerClassDoc.md new file mode 100644 index 0000000..86b80c8 --- /dev/null +++ b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerClassDoc.md @@ -0,0 +1,17 @@ +### Buzzer class +To give a demonstration on how classes in c++/arduino work, i decided to code something easy and repeatable. + +This class is meant to assign a input and and output source for a button to activate a buzzer, and a buzzer to be activated by a button. + +This is done by using private variables and public functions that call to the private variables. + +Inside of the class a constructor is made. +(in c++ this is the name of the class itself.) +every time the class is called uppon, the consctructor gets activated with the given data. + +In this case the buzzer pin and Button pin are given with the new object. + +This class uses public and private acces keys. + +The variables to determine the pins are st to private so these can't be alterd by any other means besides the ones assigned to it. + diff --git a/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerclasses.ino b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerclasses.ino new file mode 100644 index 0000000..16467ca --- /dev/null +++ b/docs/LearningProcessBram/ArduinoExperience/classesArduino/buzzerclasses.ino @@ -0,0 +1,30 @@ +class BuzzerPin{ + private: + int buzzerPin; + int button; + public: + BuzzerPin(int bp, int but){ + buzzerPin = bp; + button = but; + pinMode(button, INPUT); + pinMode(buzzerPin, OUTPUT); + } + + void activate(){ + if(digitalRead(button) == HIGH){ + digitalWrite(buzzerPin, HIGH); + }else{ + digitalWrite(buzzerPin, LOW); + } + } +}; + +BuzzerPin buzzerOne(12, 20); + +void setup(){ + +} + +void loop() { +buzzerOne.activate(); +} \ No newline at end of file