//Blink and buzz "XENIA" in Morse Code with adjustable tempo, created by Ms. Czifrik
//Version 3: With arrays and "for" cycle for bulk data entry and compact code
int LED=9;
int BUZZER=3;
int t=100;
int voltage[]={LOW,LOW, HIGH,LOW, HIGH,HIGH, HIGH,HIGH, HIGH,LOW, HIGH,LOW, HIGH,LOW,
HIGH,LOW, HIGH,LOW, HIGH,LOW, HIGH,LOW};
int pitch[]={800,0, 600,0, 400,0, 250,0, 400,0, 400,0, 300,0, 400,0, 400,0, 1000,0, 400,0};
int duration[]={3*t,t, t,t, t,t, 3*t,3*t, t,3*t, 3*t,t, t,3*t, t,t, t,3*t, t,t, 3*t,7*t};
void setup()
{
pinMode(LED, OUTPUT);
pinMode(BUZZER, OUTPUT);
for(int i=0; i<22; i++)
{
digitalWrite(LED, voltage[i]);
tone(BUZZER, pitch[i]);
delay(duration[i]);
}
}
void loop()
{
}