#include "Particle.h"
uint32_t currentMillis;
SYSTEM_THREAD(ENABLED);
PRODUCT_ID(7);
PRODUCT_VERSION(10);
void setup() {
pinMode(A6, INPUT_PULLDOWN);
startMillis = millis();
attachInterrupt(A6, theInterrupt, CHANGE);
attachInterrupt(A7, theInterrupt, CHANGE);
}
void loop() {
currentMillis = millis();
if (currentMillis - startMillis >= 1000) {
startMillis = currentMillis;
Serial.println(digitalRead(A6));
}
}
void theInterrupt() {
Serial.println("interrupted");
}
When I attach an interrupts to ONLY A6, it works just fine. But when I ALSO attach an interrupt to A7, then A7 works fine, but A6 stops working.
I am flashing to a B Series B402.
Any ideas whats going on here?