基于am3358的led跑马灯测试 分类: TI-AM335X 2015-06-10 11:03 239人阅读 评论(0) 收藏
#include <sys/ioctl.h>
#include<stdio.h>
#include <fcntl.h>
#include <sys/types.h>
static int fb;
int main()
{
int i=0;
printf("hello world !\n");
fb = open("/dev/led", O_RDWR);//打开设备
if (fb < 0)
{
perror("open device leds fail");
}
for(i=0;i<100;i++)
{
ioctl(fb, 1, i%4+1);
usleep(200000);
ioctl(fb, 0, i%4+1);
}
// close(fb);
return 0;
}版权声明:本文为博主原创文章,未经博主允许不得转载。
浙公网安备 33010602011771号