[英]implicit declaration of function 'wiringPilSR'
我正在嘗試使用connectioningPI的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'
”。 我已經在sparkfun上設置了本教程中所示的構建命令
函數wiringPilSR
的拼寫不是小寫的L (l)
,而是第9個字符是大寫的i (I)
要花一個小時才能弄清楚
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.