配線PIの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でコードをビルドしようとすると、私は「undefined reference to 'wiringPilSR'
を」警告「implicit declaration of function 'wiringPilSR'
」とエラーが表示されます。機能wiringPilSR
が小文字L (l)
で綴られていません。このtutorial on sparkfun
それを考え出すために一時間をそこに行く
'wiringPilSR'の定義は何ですか? –
それを考え出した。とにかくありがとう – Alexander