ESP8266 Developer Zone The Official ESP8266 Forum 2017-03-24T17:53:15+08:00 https://bbs.espressif.com:443/feed.php?f=65&t=3273 2017-03-24T17:53:15+08:00 2017-03-24T17:53:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3273&p=11564#p11564 <![CDATA[Re: AttachInterrupt on NodeMCU]]> Try to remove the parenthesis after doSth:

Code:

attachInterrupt(D4, doSth, CHANGE);

Statistics: Posted by Tercero — Fri Mar 24, 2017 5:53 pm


]]>
2017-01-18T22:50:35+08:00 2017-01-18T22:50:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3273&p=11134#p11134 <![CDATA[AttachInterrupt on NodeMCU]]> Everything I found tells me that this code is OK?!


Code:

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:


Image


I still have no idea after hours of research!
Thanks a lot in advance :-)

Statistics: Posted by pxlstuermer — Wed Jan 18, 2017 10:50 pm


]]>