Grove - Buzzer
This project will output sound to a Grove Buzzer whenever a Grove Push Button is pressed.
- Connect a Grove Push Button tto a grove connector on your board and a Grove Buzzer.
- Begin a new Grove project using the Grove Project Import method at the bottom of this page.
- In the Project Explorer on the left, under Sources, double click to open the file "arduinoApp.cpp".
- Copy and paste the following code into this file to replace it's contents:
//--------- Buzzer Test #include "arduinoApp.h" int speakerPin = 6; // Grove Buzzer connect to this pin void setup() void playTone(int tone, int duration) { void loop() |
- Select Project from the main menu and choose Build Project.
- If there are any errors they will be displayed in the Problems tab.
Now follow the steps under Debugging your ARM Board Project.