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