18 lines
801 B
Markdown
18 lines
801 B
Markdown
### 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.
|
|
|