📄 ledshow.c
字号:
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include "stdio.h"#include "sys/types.h"#include "sys/ioctl.h"#include "stdlib.h"#include "termios.h"#include "sys/stat.h"#include "fcntl.h"#include "sys/time.h"int main(){ int on=1; int led; int fd; fd = open("/dev/leds", 0); if (fd < 0) { perror("open device leds"); exit(1); } printf("leds test show. press ctrl+c to exit \n"); while(1) { for(led=0;led<5;led++) { ioctl(fd, on, led); usleep(50000); } on=!on; } close(fd); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -