www.pudn.com > EXT.rar > testLED.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{
int fd1,fd2;
int i,ret;
int buf;
fd1=open("/dev/SimpleLED",O_RDWR);
if (fd1<0)
{
printf("Error open SimpleLED\n");
}
else
{
printf("Open SimpleLED success!\n");
}
for(;;)
{
buf=random();
//printf(">x\n",buf);
usleep(1000);
write(fd1,&amt;buf,buf);
}
return 0;
}