
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.
Summary of Contents for KS0077
Page 1: ...keyestudio www keyestudio com 1 Super Learning Kit for Arduino...
Page 14: ...keyestudio www keyestudio com 14 Connection for UNO R3 Connection for 2560 R3...
Page 32: ...keyestudio www keyestudio com 32 Connection for 2560 R3...
Page 42: ...keyestudio www keyestudio com 42 Connection for MEGA 2560...
Page 45: ...keyestudio www keyestudio com 45 Connection for UNO R3 Connection for 2560 R3...
Page 59: ...keyestudio www keyestudio com 59 Connection for 2560 R3...
Page 66: ...keyestudio www keyestudio com 66 Connection for 2560 R3...
Page 72: ...keyestudio www keyestudio com 72 Manual for LED Segment Display Connection for UNO R3...
Page 85: ...keyestudio www keyestudio com 85 8 bit Connection Method Connection for UNO R3...
Page 94: ...keyestudio www keyestudio com 94 Connection for 2560 R3 Connect the motor to digital pin 9...