⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test1.c

📁 2440 下的5*5按键驱动程序.请参看具体代码内容.
💻 C
字号:
#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h>


main()
{
   int retval;
   int fileno;
   int ts, maxfd;
   int ret= 0,i,j;
   int number;
   fileno = open("/dev/button",O_RDWR);
       if (fileno == -1) {
               printf("open device led errr!\n");
               return 0;
              }	printf ("open succeed");
   while(1) {
   read(fileno,&number,1);
   printf("key=0x%x\n",number);
    }
   close(fileno);
   return 0;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -