Sonido con Arduino
Código pitido básico.
Código piratas del caribe.
void setup() {
#define SONIDO 7
#define TEMPO 120
#define Do 262
#define Re 294
#define Mi 320
#define Fa 349
#define Sol 392
#define La 440
#define Si 494
#define Do_alto 523
#define NEGRA 60000/TEMPO
#define REDONDA NEGRA*4
#define BLANCA NEGRA*2
#define CORCHEA NEGRA/2
#define SEMICORCHEA NEGRA/4
pinMode (7, OUTPUT);
// Empieza la cancio de PIRATAS DEL CARIBE
tone (SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone (SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Si,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone (SONIDO,Do,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Re,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone (SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone (SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Si,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone (SONIDO,Do,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Re,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone (SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,NEGRA);
delay(CORCHEA*1.3);
tone (SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone (SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Do,CORCHEA);
delay(CORCHEA*1.3);
tone (SONIDO,Re,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Re,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Re,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Fa,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Fa,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Re,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Si,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Re,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Do,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Do,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Mi,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,La,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Si,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Do,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Do,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Re,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,Si,NEGRA);
delay(NEGRA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,Sol,CORCHEA);
delay(CORCHEA*1.3);
tone(SONIDO,La,CORCHEA);
delay(CORCHEA*1.3);
}
void loop() {
}
Comentarios
Publicar un comentario