Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- 주가예측
- 백준
- 개발자
- C++
- 코스닥
- 사물인터넷
- frontend
- 프로그래밍
- backend
- 개인프로젝트
- SNS
- 코딩
- 풀스택프레임워크
- java정리
- 빅데이터
- 이웃한 칸
- 모의 주식
- 자바정리
- 코딩독학
- Python
- 프로그램
- 코테
- 자바독학
- Project
- 코딩테스트
- java
- Reflex
- 자바
- 개발
- 프로그래머스
Archives
- Today
- Total
Creative Code
12_timer1_piezo 본문
#include <TimerOne.h>
const int BUZZER = 10;
const int melody[] = {262,294,330,349,393,440,494,523,};
void setup() {
// put your setup code here, to run once:
Timer1.initialize();
Timer1.pwm(BUZZER,0);
Timer1.setPwmDuty(BUZZER,100);
for (int note = 0; note<8; note++) {
Timer1.setPeriod(1000000/melody[note]);
delay(500);
}
Timer1.setPwmDuty(BUZZER,0);
}
void loop() {
// put your main code here, to run repeatedly:
}
'Arduino(C,C++)' 카테고리의 다른 글
14_FND (0) | 2023.08.14 |
---|---|
13_PCINT_ultrasonic(timer1함수를 이용한 거리측정) (0) | 2023.08.14 |
11_timer1_led (0) | 2023.08.14 |
10_ultrasonic(초음파 거리재기) (0) | 2023.08.11 |
09_tone (0) | 2023.08.11 |