标签:
#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/beep", O_RDWR); if (fb < 0) { perror("open device beep fail"); } for(i=0;i<100;i++) { ioctl(fb, 1, i); usleep(200000); } ioctl(fb, 0, 1);//关闭蜂鸣器驱动 close(); return 0; }
标签:
原文地址:http://blog.csdn.net/mao0514/article/details/46439591