Buzzer and led control

My connection and code for buzzer and led control is alright but it is not working.

Kindly send the image of your circuit. Even if the connections are correct, there are chances of having a loose contact. Also do not use a resistor for the buzzer, it will not produce any sound.

Do not use a resistor with buzzer. Check your code once there may be some errors in it.

since you have not given any image or code this might be the possible problems in your projects

  1. error in your code, check your code thoroughly twice
  2. hardware related, buzzer does not have any polarity but led has polarity, correctly connect the anode and cathode, don’t forget to connect resistor value of 220 ohm in series with led, make sure you have not shorted your circuit
  3. If everything is right then either your buzzer or led might be damaged, replace it and give it a try.
    hope you got some useful information @bhaduri.ankan