基于am3358的led跑马灯测试

来源:互联网 发布:java 函数形参和实参 编辑:程序博客网 时间:2024/04/30 19:24


#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;}


0 0