Buzz Buzz! (Buzzer with Grove Sensor Adapter)
The Grove buzzer lets your EV3 project easily get your attention with a loud sound. The mindsensors Grove Sensor Adapter makes it easy to connect it to your EV3. In this demo we use a countdown alarm as an example, but you might also use this to alert you if your plant needs watering.
This first program simply makes a repeating beep.
That's it! Use the Mindsensors GroveSensorAdapter block (see downloads below) and change the mode to Digital. You can specify true or false to turn the buzzer on or off. You could also wire in a logic signal from another block for a more advanced application. Here we turn it on, wait for a short time (1/5 second), then turn it off. Then we wait four fifths of a second before letting the buzzer buzz again. In total the loop takes one second.
Now we an example program of using the Grove buzzer to make an alarm. Remember the example programs can be downloaded below. First we have a loop that updates the display on screen. We get how many seconds are left, divide by 60 to get the number of minutes, then combine those with a colon to show it on screen.
After the timer finishes and the loop ends, we play an alarm for one minute. As with the simple program we repeatedly turn the buzzer on and off, but we use an additional loop to get 4 beeps then a pause.
beep beep beep beep ..... beep beep beep beep .....
Downloads and Links
The thumbnail is from the Seeed wiki for Grove devices.