#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/time.h>
#include <errno.h>
int main(void)
{
int i;
int buttons_fd;
int key_value[4]={1,2,3,0};
printf("this is wirte read!!\n");
/*打开键盘设备文件*/
buttons_fd = open("/dev/the_clock_io", 2);
if (buttons_fd < 0) {
perror("open device buttons");
exit(1);
}
int count,set;
for (;;) {
//printf("please input the num and value!!\n");
//scanf("%d,%d",&count,&set);
//*key_value=set;
//write(buttons_fd,key_value,count);
printf("you want close ,input 3 :\n");
scanf("%d",&count);
if(3==count)
break;
}
/*关闭设备文件句柄*/
close(buttons_fd);
return 0;
}