LED and piezo

a very simple tutorial that blinks a led and makes a piezo beep
join led with a 220 ohm resistor to pin 13 and piezo with a resistor of your choice to pin 3

int piezoPin = 3;
int ledPin = 13;

void loop()
{
  digitalWrite(piezoPin, HIGH);
  digitalWrite(ledPin, HIGH);
  delay (1000)
  digitalWrite(piezoPin, LOW);
  digitalWrite(ledPin, LOW);
  delay (1000)
}

please let me know if this is better than the blink example

devcoder:
a very simple tutorial

Apart from its incompleteness as Delta_G points out, it's not a tutorial in the first place. A tutorial needs to, well, tutor*, that is provide some guidance to aid understanding, not just throw out a solution (even if the solution is technically correct which this isn't).

*tute?

devcoder:
and piezo with a resistor of your choice to pin 3

Is it ok if I choose this one?

link.jpg

link.jpg