/*----------------------------------------------------------------------- Piezo Tester This tests for the ideal frequencies of two diffrent Piezo Alarms. Each Piezo should cycle through a range of freqencies with one second beeps, while writing the frequency to the 9600 Serial band. Make sure to note which frequencies are loundest/most annoying. THe full instructable can be found at: Created 14 May 2016 Last Modified 18 May 2016 By Just4Fun Media Find more code files at http://Just4FunMedia.TK Under the "Apps/Coding" Tab If you have any issues feel free to visit http://Just4FunMedia.TK and use the form found under the "Contact" Tab or comment on thr relavent instructable Have a great day! :-) ************************************************************************** */ void setup() { // put your setup code here, to run once: pinMode(9, OUTPUT); // sets the pins as output pinMode(10, OUTPUT); // sets the pins as output Serial.begin(9600); // Start Serial Communication } void loop() { // put your main code here, to run repeatedly: for (int x = 0; x < 100; x++){ // loop for 100 freqencies analogWrite(9, x); // Start Playing Tone Serial.print("Pin 9 - Frequency " + x); delay(1000); analogWrite(9, 0); // Stop Playing Tone delay(500); } for (int x = 0; x < 100; x++){ // loop for 100 freqencies analogWrite(10, x); // Start Playing Tone Serial.print("Pin 10 - Frequency " + x); delay(1000); analogWrite(10, 0); // Stop Playing Tone delay(500); } }