I'm trying to figure out how the AttachedInterrupt
works on the NodeMCU. Everything I found tells me that this code is OK?!
void setup() {
Serial.begin(9600);
pinMode(D4, INPUT);
attachInterrupt(D4, doSth(), CHANGE);
}
void loop() {
Serial.println(digitalRead(D4));
delay(100);
}
void doSth() {
Serial.println("Check!");
}
But I just get this error:
I still have no idea after hours of research!
Thanks a lot in advance :-)
Problem solved — Thanks again!
I just used attachInterrupt(D4, doSth, CHANGE);
instead of attachInterrupt(D4, doSth(), CHANGE);