From: Ivan Stefanov Date: Sun, 29 Nov 2020 23:47:16 +0000 (+0200) Subject: Update Timer_1_COMPA_Toggle_pin_13_at_1Hz.ino X-Git-Url: https://kolegite.com/gitweb/?a=commitdiff_plain;h=71bf07341af90944cd8cbd598bdab143104ba8fc;p=vmks.git Update Timer_1_COMPA_Toggle_pin_13_at_1Hz.ino --- diff --git a/Examples/Timer_1_COMPA_Toggle_pin_13_at_1Hz/Timer_1_COMPA_Toggle_pin_13_at_1Hz.ino b/Examples/Timer_1_COMPA_Toggle_pin_13_at_1Hz/Timer_1_COMPA_Toggle_pin_13_at_1Hz.ino index d51c257..d603aa4 100644 --- a/Examples/Timer_1_COMPA_Toggle_pin_13_at_1Hz/Timer_1_COMPA_Toggle_pin_13_at_1Hz.ino +++ b/Examples/Timer_1_COMPA_Toggle_pin_13_at_1Hz/Timer_1_COMPA_Toggle_pin_13_at_1Hz.ino @@ -36,13 +36,13 @@ void loop() { // put your main code here, to run repeatedly: } -// Timer1 Interrupt Service Routine (ISR) -// Toggle pin 13 (LED) every 1s -ISR(TIMER1_COMPA_vect) { - /* - * Generates pulse wave of frequency 1Hz/2 = 0.5Hz - * Takes two cycles for full wave - toggle high then after 1s toggle low after 1s repeat - */ +/* + Timer1 Interrupt Service Routine (ISR) + Toggle pin 13 (LED) every 1s + Generates pulse wave of frequency 1Hz/2 = 0.5Hz + Takes two cycles for full wave - toggle high then after 1s toggle low after 1s repeat +*/ +ISR(TIMER1_COMPA_vect) { if (toggle == 1) { digitalWrite(13, HIGH); toggle = 0;