It is one way to use their Sound Detector.
Sparkfun arduino uno pinout code#
This is the code provided on Sparkfun's hookup guide. It queries the state of that pin, and sets the onboard LED to reflect thatĪttachInterrupt(IRQ_GATE_IN, soundISR, CHANGE) When digital input 2 changes state, this routine This function is installed as an interrupt service routine for the pin * Distributed as-is no warranty is given. * local, and you've found our code helpful, please buy us a round! * This code is beerware if you see me (or any other SparkFun employee) at the * Tested on Redboard, 3.3v/8MHz and 5v/16MHz ProMini hardware. * The Sound Detector is connected to the Adrduino as follows: * For more details about the Sound Detector, please check the hookup guide. * sampled in the loop(), and it prints an indication of the level to the * (an analog voltage to rises to indicate the amplitude of the sound) is * ISR, which lights an LED when the sound is present. * is present, and low when conditions are quiet) is used to fire a pin-change The gate output (a binary indication that is high when sound * This sketch demonstrates two different modes of usage for the Sound * binary indication of the presence of sound and an analog representation
![sparkfun arduino uno pinout sparkfun arduino uno pinout](https://cdn.shopify.com/s/files/1/1034/1611/products/14871-Arduino_Uno_WiFi_R2_-02_1024x.jpg)
It provides not only an audio output, but also a * The Sound Detector is a small board that combines a microphone and some * This sketch demonstrates the use of the Sparkfun Sound Detector board. The code for the Ultrasonic Sensor is rigid (unless if you add another component), and the only thing that changes would be the digital io pin in the if statement (if you used different digital pins than from the hardware example provided). The code paints the same exact picture as the schematics, with the Sound Detector being more flexible and the Ultrasonic Sensor being simpler.
![sparkfun arduino uno pinout sparkfun arduino uno pinout](https://duino4projects.com/wp-content/uploads/2018/11/Arduino-Uno-Pinout-Diagram.jpg)
The Sound Detector has three outputs for flexibility, but only matches out with the Ultrasonic Sensor due to the latter's simplicity for beginners.
![sparkfun arduino uno pinout sparkfun arduino uno pinout](https://1.bp.blogspot.com/-D6eq2Mb96zI/XNCRctz-t2I/AAAAAAAAovU/HnRJSngzfBwY3C8CNh7L-r4qoHYex1HywCLcBGAs/s1600/Arduino%2BUNO%2Bsimple%2Bpinout.png)
The sound detector has three different outputs for changing audio signals and is very flexible and sensitive.