Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用Arduino固件在ESP8266上安装中断_Android_C_Interrupt_Esp8266_Arduino Esp8266 - Fatal编程技术网

Android 使用Arduino固件在ESP8266上安装中断

Android 使用Arduino固件在ESP8266上安装中断,android,c,interrupt,esp8266,arduino-esp8266,Android,C,Interrupt,Esp8266,Arduino Esp8266,我正在试图弄清楚attachedintrupt是如何在NodeMCU上工作的。我找到的所有东西都告诉我这个密码没问题 void setup() { Serial.begin(9600); pinMode(D4, INPUT); attachInterrupt(D4, doSth(), CHANGE); } void loop() { Serial.println(digitalRead(D4)); delay(100); } void doSth() { Serial

我正在试图弄清楚
attachedintrupt
是如何在NodeMCU上工作的。我找到的所有东西都告诉我这个密码没问题

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!");
}
但我只是得到了这个错误:

经过几个小时的研究,我还是不知道


提前非常感谢:-)

问题解决了-再次感谢

我刚刚使用了
attachintrupt(D4,doSth,CHANGE)


而不是
attachintrupt(D4,doSth(),CHANGE)

问题已解决-再次感谢

我刚刚使用了
attachintrupt(D4,doSth,CHANGE)


而不是
attachintrupt(D4,doSth(),CHANGE)

您不应在ISR内使用串行打印。将其移动到循环()。

您不应在ISR内使用串行打印。将其移动到您的循环()。

我没有使用中断,但在我看来,
doSth()
正在被调用而不是传递。我想应该是
doSth
。天才!就这样:)非常感谢你!我没有使用中断,但在我看来,
doSth()
正在被调用而不是传递。我想应该是
doSth
。天才!就这样:)非常感谢你!