Código:
int led = 4;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
blinkPattern();
}
void blinkPattern() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
Código:
int led = 4;
int speaker = 5;
void setup() {
pinMode(led, OUTPUT);
pinMode(speaker, OUTPUT);
}
void loop() {
// blinkPattern();
tone(speaker, 1760);
}
void blinkPattern() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
Código:
int led = 4;
int speaker = 5;
int C = 1046;
int D = 1175;
int E = 1319;
int F = 1397;
int G = 1598;
int A = 1760;
int B = 1976;
int C1 = 2093;
void setup() {
pinMode(led, OUTPUT);
pinMode(speaker, OUTPUT);
}
void loop() {
//blinkPattern();
tone(speaker, F);
delay(500);
tone(speaker, A);
delay(500);
noTone(speaker);
delay(1000);
tone(speaker,C);
delay(500);
tone(speaker,D);
delay(500);
}
void blinkPattern() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
Código:
int led = 4;
int speaker = 5;
int C = 1046;
int D = 1175;
int E = 1319;
int F = 1397;
int G = 1598;
int A = 1760;
int B = 1976;
int C1 = 2093;
void setup() {
pinMode(led, OUTPUT);
pinMode(speaker, OUTPUT);
}
void loop() {
//blinkPattern();
tone(speaker, F);
delay(500);
tone(speaker, A);
delay(500);
noTone(speaker);
delay(1000);
tone(speaker,C);
delay(500);
tone(speaker,D);
delay(500);
tone(speaker, E);
delay(1000);
tone(speaker, D);
delay(1000);
tone(speaker, C);
delay(1000);
noTone(speaker);
delay(1000);
tone(speaker, E);
delay(1000);
tone(speaker, D);
delay(1000);
tone(speaker, C);
delay(1000);
noTone(speaker);
delay(1000);
}
void blinkPattern() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
No hay comentarios:
Publicar un comentario