This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:c4eng:fall2023:projects:ptb0 [2023/10/05 12:31] – [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: | ||
- | GPIO_PIN = the wiringPi pin number or the name you declared for that pin | + | * GPIO_PIN = the wiringPi pin number or the name you declared for that 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: | ||
- | GPIO_PIN = the wiringPi pin number or the name you declared for that pin | + | * GPIO_PIN = the wiringPi pin number or the name you declared for that pin |
- | | + | |
====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). |