/****************************************************************** * Single_Tone_10ms.pde * * Programmer: Thomas Trickel * * Creation Date: 1/4/11 * Last Modification Date: 1/05/011 * * Description: This program will produce a single 10ms square wave tone on a speaker via * output on PORTC bit 0 * * Input: No user input. * * Output: A 10ms square wave meant to drive a speaker ******************************************************************/ // The setup() method runs once, when the sketch starts void setup() { pinMode(PIN_C0, OUTPUT); // initialize the pin C0 as an output } // end of setup function /******************* * loop() * * Description: Set pin C0 high, wait 5ms, set pin C0 low, wait 5ms, and repeat * * Note: The while(1) loop isn't strictly necessary as the loop function gets repeatedly * called by the Arduino overmind * * Inputs: None * * Outputs: None */ void loop() { while(1) { digitalWrite(PIN_C0, HIGH); delay(5); digitalWrite(PIN_C0, LOW); delay(5); } // end of while(1) loop } // end of loop function