Beep the ThinkerShield's piezo buzzer (D3) with the tone(pin, frequency, duration) command.
From the unit Crack the Code
· activity PRP 4: Digital output — Buzzer
int buzzerPin = 3; // the piezo buzzer is on pin D3 of the ThinkerShield
void setup() {
pinMode(buzzerPin, OUTPUT); // the buzzer pin is an output
}
void loop() {
tone(buzzerPin, 600, 30); // play a 600 Hz tone for 30 ms...
delay(150); // ...then wait 150 ms before repeating
}
Shared from Little Bird Electronics curriculum.