本帖最后由 Y0UT00 于 2014-10-16 15:12 编辑
sudo apt-get install libi2c-dev ;wiringPi 已经安装。
编译以下C文件时报错:“error wiringSetup was not declared in this scope"
“error digitalWrite was not declared in this scope"
到底什么情况啊,感觉像wiringP.h就没加载一样;PS: gpio-v 检查正常;readall可以看到所有端口。
#include<stdio.h>
#include<wiringPi.h>
#include<wiringSerial.h>
#define LED 0
int mian()
{
printf("LED1 Test...\r\n");
if(wiringSetup() < 0)return 1;
pinMode(LED,OUTPUT);
while(1)
{
digitalWrite(LED,HIGH);
delay(500);
digitalWirte(LED,LOW);
delay(500);
}
}
|