This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
notes:c4eng:fall2023:projects:ptb0 [2023/10/05 12:32] – [CODING THE SPEAKER] acuno | notes:c4eng:fall2023:projects:ptb0 [2023/10/05 12:32] (current) – [CODING THE SPEAKER] acuno | ||
---|---|---|---|
Line 28: | Line 28: | ||
</ | </ | ||
Where: | Where: | ||
- | * Unordered List ItemGPIO_PIN | + | * GPIO_PIN |
- | * Unordered List ItemSTATE | + | * STATE = HIGH or LOW to either enable or disable the GPIO_PIN |
The passive speaker needs to also be given a tone, in Hz, to function. | The passive speaker needs to also be given a tone, in Hz, to function. | ||
Line 37: | Line 37: | ||
</ | </ | ||
Where: | Where: | ||
- | * Unordered List ItemGPIO_PIN | + | * GPIO_PIN |
- | * Unordered List ItemTONE | + | * TONE = Frequencyof tone to use, or the name you declared for that variable |
====GPIO MODE SETTING==== | ====GPIO MODE SETTING==== | ||
To initialize our GPIO pins, we use the pinMode() function with the first argument being the pin number, and the second argument being the state (input or output). | To initialize our GPIO pins, we use the pinMode() function with the first argument being the pin number, and the second argument being the state (input or output). |