#주제 1 : 아두이노 음악 연주 프로그램
- 아두이노 > 적용(A) > #20.F > #1
- AA.20.F.1.7
전처리문 추가
#define PIN 11
#define G4 392
#define A4 440
#define E4 330
#define t 1000
void setup() {
int i;
int a[7] = {G4, G4, A4, A4, G4, G4, E4};
int b[7] = {t, t, t, t, t, t, 2*t};
for ( i = 0; i < 7; i++) {
tone(PIN, a[i], b[i]);
delay(b[i]);
}
noTone(PIN);
}
void loop() {
}