# 명칭
Buzzer, 부저
# 기능
소리를 낸다.
# 부저 1개로 소리내기
목표 : 부저로 도레미파솔라시도 소리를 내기
준비물 : 아두이노 보드, 브레드보드 USB 케이블, 부저, 점퍼케이블
## 회로도
## 코드 (Sketch)
int buzzerPin = 5;
void setup() {
pinMode(buzzerPin, OUTPUT);
}
void loop() {
tone(buzzerPin, 242);
delay(500);
tone(buzzerPin, 294);
delay(500);
tone(buzzerPin, 330);
delay(500);
tone(buzzerPin, 349);
delay(500);
tone(buzzerPin, 392);
delay(500);
tone(buzzerPin, 440);
delay(500);
tone(buzzerPin, 494);
delay(500);
tone(buzzerPin, 523);
delay(500);
notone(buzzerPin);
}
## 코드 (codeiPlus)
## 디버깅
* 회로 확인하기
- 부저의 +극이 5번 핀에, -극이 GND 핀에 제대로 연결되어 있나요?
* 코드 확인하기
- buzzerPin 값을 5으로 저장했는가?
- 마지막에 notone 명령어를 사용했는가?