EasyManuals Logo

SeeedStudio Grove Series User Manual

Default Icon
51 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #21 background imageLoading...
Page #21 background image
CODE
This example is available here: File > Sketchbook > LaunchPad_Kit > Grove_Modules > buzzer
/*
Buzzer
The example use a buzzer to play melodies. It sends a square wave of the
appropriate frequency to the buzzer, generating the corresponding tone.
The circuit:
* Buzzer attached to pin39 (J14 plug on Grove Base BoosterPack)
* one side pin (either one) to ground
* the other side pin to VCC
* LED anode (long leg) attached to RED_LED
* LED cathode (short leg) attached to ground
* Note:
This example code is in the public domain.
http://www.seeedstudio.com/wiki/index.php?title=GROVE_-_Starter_Kit_v1.1b#Grove_-
_Buzzer
*/
/* Macro Define */
#define BUZZER_PIN 39 /* sig pin of the buzzer */
int length = 15; /* the number of notes */
char notes[] = "ccggaagffeeddc ";
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;
void setup()
{
批注 [9]: Update with latest code

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SeeedStudio Grove Series and is the answer not in the manual?

SeeedStudio Grove Series Specifications

General IconGeneral
BrandSeeedStudio
ModelGrove Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals