/* Sample program to send 440 Hz signal to the buzzer on Wytec EduBase board * This program toggles the output pin 37 at 440 Hz using 1126 ms delay * between toggles. Pin 37 is connected to the buzzer on Wytec EduBase board. */ /* Tiva TM4C123 */ //const int BUZZER = PC_4; const int BUZZER = 37; const int HALF_PERIOD = 1126; void setup() { // initialize the digital pin as an output. pinMode(BUZZER, OUTPUT); } void loop() { digitalWrite(BUZZER, HIGH); // turn the signal to buzzer high delayMicroseconds(HALF_PERIOD); // wait for half cycle digitalWrite(BUZZER, LOW); // turn the signal to buzzer low delayMicroseconds(HALF_PERIOD); // wait for half cycle }