Basti’s Buggy Blog

Poking at software.

Wemos D1 Mini Pro Digital Interrupt Pins

I was observing weird behavior when trying to handle interrupts from certain pins on a WEMOS D1 mini Pro.

Goal

  • Register ISRs for rising and falling edges on as many pins as possible
  • Keep a stable system
  • Keep I²C functionality

TL;DR

  • The pins D5, D6, D7 work without restrictions
  • D3 and D4 work, but can not be low on boot, otherwise the WEMOS freezes12
  • D1 and D2 are used for I²C by default3, not changed for compability
  • D04 and D85 have no support for interrupts

Implementation

ICACHE_RAM_ATTR void my_isr(){ /* ... */ }

void setup() {
  pinMode(MY_INT_PIN, INPUT_PULLUP);
  attachInterrupt(MY_INT_PIN, my_isr, CHANGE);
}

  1. WEMOS D1 Mini - mir gehen die Pins aus, 2020-06-08 21:12 ↩︎

  2. GitHub - xreef / PCF8574_library ↩︎

  3. D1 mini Pro - WEMOS documentation, 2020-06-08 21:11 ↩︎

  4. WeMos D1 mini für Einsteiger, 2020-06-08 21:08 ↩︎

  5. Could not find a reference. Did not work for me. ↩︎

See Also