I am trying to get data from a Giger sensor (https://www.aliexpress.com/item/Good-Qu ... 54504.html) to a NodeMCU ESP8266 board (https://www.amazon.com/HiLetgo-Internet ... 010N1SPRK/).
I am using Arduino to program the ESP.
The sensor generates low pulse interrupt of 200micro seconds and the processor has to count no. of interrupt in a minute.
The interrupt is not triggering in the ESP however it does trigger in an Arduino Uno. I have tested the code and it does work when I manually cause the interrupt.
const byte interruptPin = D1;
volatile unsigned int interruptCounter = 0;
void setup() {
Serial.begin(115200);
pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt, FALLING);
}
void handleInterrupt() {
++interruptCounter;
}
void loop() {
unsigned long init_time = millis();
Serial.println("Counting");
while(millis()-init_time <= 15000){
delay(1000);
Serial.print('.');
}
Serial.print("Count/min is:");
Serial.println((unsigned int)(interruptCounter<<2));
interruptCounter = 0;
}