0
我试图使用wiringPI的wiringPilSR
将中断附加到引脚。我的代码如下所示:函数隐式声明'wiringPilSR'
#include <wiringPi.h>
#include <stdio.h>
int inPin = 3;
void myInterrupt();
int main(vodi){
wiringPilSetupGpio();
pinMode(inPin, INPUT);
wiringPilSR(inPin, INT_EDGE_RISING, &myInterrupt);
while(1){
printf("Cycle repeated\n");
delay(1000);
}
return 0;
}
void myInterrupt(){
printf("Interrupted");
return 0;
}
当我尝试建立在Geany的代码,我得到一个警告“implicit declaration of function 'wiringPilSR'
”错“undefined reference to 'wiringPilSR'
”。我已经设置了构建命令如本tutorial on sparkfun
'wiringPilSR'的定义是什么? –
想通了。无论如何感谢 – Alexander