Ambulance Sound Effect using a Seeeduino Xiao

Description: A Speaker 8 Ohm .5W connected to 4 LEDs and a Seeeduino Xiao plays a European Ambulance sound effect while also flashing ON/OFF the blue LEDs.

Ambulance Sound Effect with Nerdonic Exen Mini

Supplies:

1 – Breadboard 400 Points
1 – Seeeduino Xiao   >> Link <<
1 – Speaker 8 Ohm .5W   >> Link <<
4 – LED
1 – 220 Ohm Resistor

Arduino Code:

int speaker = 9;

#define led1 0
#define led2 1
#define led3 3
#define led4 2

void setup() {

  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);

}

void loop() {

  tone(speaker, 10);
  digitalWrite(led1, HIGH);
  digitalWrite(led2, HIGH);
  digitalWrite(led3, HIGH);
  digitalWrite(led4, HIGH);
  delay(1000);
  tone(speaker, 30);
  digitalWrite(led1, LOW);
  digitalWrite(led4, LOW);
  delay(1000);

}

Leave a Comment

21 − = 19