
keyestudio
www.keyestudio.com
30
When connecting the circuit, pay attention to the positive and negative poles of the buzzer. In the
photo, you can see there are red and black lines. When the circuit is finished, you can begin the
programming.
Sample Code
Program is simple. You control the buzzer by outputting high/low level.
//////////////////////////////////////////////////////////
int buzzer=8;// initialize digital IO pin that controls the buzzer
void setup()
{
pinMode(buzzer,OUTPUT);// set pin mode as “output”
}
void loop()
{
digitalWrite(buzzer, HIGH); // produce sound
}
//////////////////////////////////////////////////////////
Result
After uploading the program, the buzzer experiment is completed. You can see the buzzer is
ringing.
Содержание KS0077
Страница 1: ...keyestudio www keyestudio com 1 Super Learning Kit for Arduino...
Страница 14: ...keyestudio www keyestudio com 14 Connection for UNO R3 Connection for 2560 R3...
Страница 21: ...keyestudio www keyestudio com 21 Circuit Connection Connection for UNO R3 Connection for 2560 R3...
Страница 32: ...keyestudio www keyestudio com 32 Connection for 2560 R3...
Страница 35: ...keyestudio www keyestudio com 35 Circuit Connection Connection for UNO R3 Connection for 2560 R3...
Страница 42: ...keyestudio www keyestudio com 42 Connection for MEGA 2560...
Страница 45: ...keyestudio www keyestudio com 45 Connection for UNO R3 Connection for 2560 R3...
Страница 59: ...keyestudio www keyestudio com 59 Connection for 2560 R3...
Страница 66: ...keyestudio www keyestudio com 66 Connection for 2560 R3...
Страница 72: ...keyestudio www keyestudio com 72 Manual for LED Segment Display Connection for UNO R3...
Страница 85: ...keyestudio www keyestudio com 85 8 bit Connection Method Connection for UNO R3...
Страница 94: ...keyestudio www keyestudio com 94 Connection for 2560 R3 Connect the motor to digital pin 9...
Страница 105: ...keyestudio www keyestudio com 105 Circuit Connection Connection for UNO R3 Connection for MEGA 2560 R3...