11. Piezo Buzzer - Spark Core
Buzzer would be useful in some cases, so let’s learn how to use it.
I started using Fritzing to draw how I connect things.
And code is below
// Turn on/off Piezo Buzzar // void setup() { Serial.begin(9600); pinMode(A0, OUTPUT); } void loop() { delay(1000); analogWrite(A0, 2000); delay(100); analogWrite(A0, 0); }