1

I'm using Industruino D21G (SAMD21G version) with Visual Studio Code extension for Arduino. attachInterrupt seems to have no effect. I tried Industruino CH1, CH6 and CH7 with the same result. When I poll these channels in a loop, I detect signal level change as expected. Here is the code:

#include <Arduino.h>
#include <Indio.h>

constexpr int PROXIMITY_SENSOR_NC = 6;

void setup() { pinMode(LED_BUILTIN, OUTPUT); Indio.digitalMode(PROXIMITY_SENSOR_NC, INPUT); attachInterrupt(digitalPinToInterrupt(PROXIMITY_SENSOR_NC), blink, FALLING);
digitalWrite(LED_BUILTIN, HIGH); }

void blink() { digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

void loop() { }

Any ideas what could be wrong?

Paul Jurczak
  • 209
  • 1
  • 8

1 Answers1

1

Industrial level I/O on Industruino, which includes CH1, CH6 and CH7 I tried, is not connected directly to the microcontroller. It uses a buffer and communicates through I2C in pull mode. That's why interrupt on I/O change has no effect.

Paul Jurczak
  • 209
  • 1
  • 8