hey there, im working on a school project and i had a problem with my arduino code, ill be so happy if someone will help me, i made a code for the buzzer, and the project code, when i power on the project the buzzer need to start "singing" and after it the project code will start to run , so i need to combine between the 2 codes, soory for my bad english <3 thanks
buzzer code:
void setup() {
 // put your setup code here, to run once:
pinMode(12,OUTPUT);
}
void loop() {
 // put your main code here, to run repeatedly:
 {
 Â
tone(12,944);
delay(80);
noTone(12);
delay(120);
tone(12,1044);
delay(80);
tone(12,844);
delay(100);
tone(12,1044);
delay(80);
tone(12,3500);
delay(80);
noTone(12);
delay(100000);
}
}
project code:
#include <IRremote.h>
#include <Servo.h>
Servo myservo;
int RECV_PIN = 11;
int buzz=8;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
 myservo.attach(9);
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
 pinMode(12,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(buzz,OUTPUT);
}
void loop() {
 if (irrecv.decode(&results)) {
  String s = String(results.value, HEX);
  if(s != "ffffffff"){
   Serial.println(s);
  }
  {
  if(s == "ffc23d"){
   myservo.write(2370); // set servo counter clockwise
  digitalWrite(12,LOW);
   digitalWrite(10,HIGH);
   digitalWrite (buzz,HIGH);
   delay (70);
   digitalWrite (buzz,LOW);
    delay (30);
   delay(2500);Â
   digitalWrite(10,LOW);
  }
  else if(s == "ff22dd"){
   myservo.write(570); // set servo clockwise
    if(s == "ff22dd")
    digitalWrite(12,HIGH);
   digitalWrite (buzz,HIGH);
   delay (70);
   digitalWrite (buzz,LOW);
    delay (30);
   digitalWrite (buzz,HIGH);
   delay (70);
   digitalWrite (buzz,LOW);
    delay (30);
 Â
   digitalWrite(10,LOW);
 delay(2500);Â
   digitalWrite(12,LOW);
    Â
Â
  }
 Â
   else if(s == "ffc23d"){
    digitalWrite (buzz,LOW);
   }
  }
 Â
  //Serial.println(results.value, HEX);
  irrecv.resume(); // Receive the next value
 }
}
thanks!!!