基于am3358的led跑马灯測试


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


posted on 2016-01-15 21:37  gcczhongduan  阅读(254)  评论(0编辑  收藏  举报