From e4bc8d8ad0e19d892ee6e2a199c9d72afde26dec Mon Sep 17 00:00:00 2001 From: Adam Carmichael Date: Fri, 6 Apr 2018 17:35:32 +1000 Subject: [PATCH] move Serial.println out of ISR because Serial is slow --- libraries/Rotary/examples/interrupt/interrupt.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/Rotary/examples/interrupt/interrupt.ino b/libraries/Rotary/examples/interrupt/interrupt.ino index 4915e8f..e646ab3 100644 --- a/libraries/Rotary/examples/interrupt/interrupt.ino +++ b/libraries/Rotary/examples/interrupt/interrupt.ino @@ -22,6 +22,7 @@ void setup() { } void loop() { + Serial.println(counter); } // rotate is called anytime the rotary inputs change state. @@ -29,10 +30,7 @@ void rotate() { unsigned char result = rotary.process(); if (result == DIR_CW) { counter++; - Serial.println(counter); } else if (result == DIR_CCW) { counter--; - Serial.println(counter); } } -