const int FDo1 = 261; const int FRe = 294; const int FMi = 330; const int FFa = 349; const int FSol = 392; const int FLa = 440; const int FSi = 494; const int FDo2 = 524; const int FRe2 = 588; const int FMi2 = 660; const int FFa2 = 699; const int FSol2 = 785; const int n = 600; //Duración en ms de las notas negras const int b = n*2; //Duración de las blancas, relativo al valor de la negra const int c = n/2; //Duración de las corcheas, relativo al valor de la negra void setup() { pinMode(2, OUTPUT); } void loop() { Sol(c); Sol(c); La(n); Sol(n); Do2(n); Si(b); Sol(c); Sol(c); La(n); Sol(n); Re2(n); Do2(b); Sol(c); Sol(c); Sol2(n); Mi2(n); Do2(n); Si(n); La(n); Fa2(c); Fa2(c); Mi2(n); Do2(n); Re2(n); Do2(b); delay(2000); } void Sol(int t) { tone(2,FSol); delay(t); noTone(2); } void La(int t) { tone(2,FLa); delay(t); noTone(2); } void Do2(int t) { tone(2,FDo2); delay(t); noTone(2); } void Si(int t) { tone(2,FSi); delay(t); noTone(2); } void Re2(int t) { tone(2,FRe2); delay(t); noTone(2); } void Mi2(int t) { tone(2,FMi2); delay(t); noTone(2); } void Sol2(int t) { tone(2,FSol2); delay(t); noTone(2); } void Fa2(int t) { tone(2,FFa2); delay(t); noTone(2); }