Dream998

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

开发板:nanopi-neo (可适用其他开发板)
环境系统:ubuntu core

 

//先安装WiringPi库
git clone https://github.com/friendlyarm/WiringNP
cd WiringNP/
chmod 755 build
./build


vi test.c

#include <wiringPi.h>
int main(void)
{
wiringPiSetup() ;
pinMode (7, OUTPUT) ;
for(;;)
{
digitalWrite(7, HIGH) ;
delay (500) ;
digitalWrite(7, LOW) ;
delay (500) ;
}
}

//编译和运行test
gcc -Wall -o test test.c -lwiringPi -lpthread
sudo ./test

 

posted on 2018-09-06 13:41  Dream998  阅读(623)  评论(0编辑  收藏  举报