Hi there,
I'm using a Uno clone board.
This board had been working for me quite some time now.
Today I've loaded a test sketch below; and noticed that the Serial TX LED is blinking when I'm I rotate the Encoder.
Furthermore I noticed the "L" led is fully lit (always), after uploading a blank sketch.
Then I uploaded a the test blink sketch and the "L" LED is blinking.
Next while the test sketch is running, I grounded (with a jumper wire) the Arduino pin 2 (INT0), and saw the TX led lit for few seconds and goes off.
For my understanding so far these are all strange behaviors.
Anyone have an idea why this is happening?
/* Encoder Library - Basic Example
* http://www.pjrc.com/teensy/td_libs_Encoder.html
*
* This example code is in the public domain.
*/
#include <Encoder.h>
// Change these two numbers to the pins connected to your encoder.
// Best Performance: both pins have interrupt capability
// Good Performance: only the first pin has interrupt capability
// Low Performance: neither pin has interrupt capability
Encoder myEnc(2, 3);
// avoid using pins with LEDs attached
void setup() {
}
long oldPosition = -999;
void loop() {
long newPosition = myEnc.read();
if (newPosition != oldPosition) {
oldPosition = newPosition;
}
}
Encoder CLK -> INT0
Encoder DT -> INT1