I programed a interrupt on pins 3 and 4

Status
Not open for further replies.
I programed a interrupt on pins 3 and 4 and now I can't program other sketch, the program button does not respond.

What will be the possible problem?

How can I program other sketch?

Reprogram the bootloader?

I programmed the sketch below into a teensy 3.2 and after that I started having the problem. It used to be normal.

/* 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(3, 4);
// avoid using pins with LEDs attached

void setup() {
Serial.begin(9600);
Serial.println("Basic Encoder Test:");
}

long oldPosition = -999;

void loop() {
long newPosition = myEnc.read();
if (newPosition != oldPosition) {
oldPosition = newPosition;
Serial.println(newPosition);
}
}
 
Last edited:
Status
Not open for further replies.
Back
Top