//SN160 Phase 1 Crossing Signal Baseline //Modified by Paul and David Bradt //A sketch //using tone() function //Code from //https://www.programmingelectronics.com/an-easy-way-to-make-noise-with-arduino-using-tone/ //Specify digital pin on the Arduino that the positive lead of piezo buzzer is attached. int piezoPin = 8; #define LED_1 1 #define LED_2 2 void setup() { pinMode(LED_1, OUTPUT); //Red LED 1 pinMode(LED_2, OUTPUT); //Red LED 2 }//close setup void loop() { /*Tone needs 2 arguments, but can take three 1) Pin# 2) Frequency - this is in hertz (cycles per second) which determines the pitch of the noise made 3) Duration - how long the tone plays */ digitalWrite(LED_1, HIGH); digitalWrite(LED_2, LOW); delay(200); // wait for a .2 second digitalWrite(LED_1, LOW); digitalWrite(LED_2, HIGH); // Section of code that simulates the crossing bell tone(piezoPin, 1000, 100); delay(200); //wait for 0.2 second then start again }