void setup() { //initialize all timers except for 0, to save time keeping functions InitTimersSafe(); //sets the frequency for the specified pin bool success = SetPinFrequencySafe(led, frequency); //if the pin frequency was set successfully, turn pin 13 on if(success) { pinMode(13, OUTPUT); digitalWrite(13, HIGH); } }
//Initializes all timer objects, setting them to modes compatible with frequency manipulation. All timers are set to 488 - 500 Hz at the end of initialization. void InitTimers() { Timer0_Initialize(); InitTimersSafe(); }