User Tools

Site Tools


notes:c4eng:fall2023:projects:ptb0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:c4eng:fall2023:projects:ptb0 [2023/10/05 12:30] – [SPEAKER (PASSIVE BUZZER - SPEAKER WITH STICKER)] acunonotes:c4eng:fall2023:projects:ptb0 [2023/10/05 12:32] (current) – [CODING THE SPEAKER] acuno
Line 24: Line 24:
 The active speaker simply needs to be toggled on or off to work. The active speaker simply needs to be toggled on or off to work.
  
-"digitalWrite (GPIO_PIN, STATE)" -- where+<code> 
-     GPIO_PIN = the wiringPi pin number or the name you declared for that pin +digitalWrite (GPIO_PIN, STATE)  
-     STATE = HIGH or LOW to either enable or disable the GPIO_PIN+</code> 
 +Where
 +  GPIO_PIN = the wiringPi pin number or the name you declared for that pin 
 +  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.
  
-"softToneWrite (GPIO_PIN, TONE), where+<code> 
-     GPIO_PIN = the wiringPi pin number or the name you declared for that pin +softToneWrite (GPIO_PIN, TONE) 
-     TONE = Frequencyof tone to use, or the name you declared for that variable+</code> 
 +Where
 +  GPIO_PIN = the wiringPi pin number or the name you declared for that pin 
 +  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). 
notes/c4eng/fall2023/projects/ptb0.1696509034.txt.gz · Last modified: 2023/10/05 12:30 by acuno