1、话不多说上代码

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <sys/stat.h>
#include <unistd.h> void setLEDtrigger()
{
FILE *fp; char trigger[] = "none"; char dir[]; sprintf(dir, "/sys/class/leds/fpga_led1/trigger"); if ((fp = fopen(dir, "w")) == NULL) {
printf("Failed to open the file %s\n", dir);
}
else {
fwrite(trigger, sizeof(trigger), , fp);
fclose(fp);
}
} void setLEDBrightness()
{
FILE *fp; char dir[];
char brightness_char[] = ""; sprintf(dir, "/sys/class/leds/fpga_led1/brightness"); if ((fp = fopen(dir, "w")) == NULL) {
printf("Failed to open the file %s\n", dir);
}
else {
fwrite(brightness_char, sizeof(brightness_char), , fp);
fclose(fp);
}
} int main(int argc, char** argv)
{ setLEDtrigger();
setLEDBrightness(); return ;
}

2、

最新文章

  1. centos6配置网卡
  2. Linux文件标示
  3. aspx注入靶机源码
  4. 在AngularJS应用中实现认证授权
  5. sublime text3-代码片段配置
  6. MySQL 删除数据表
  7. Spark Streaming连接TCP Socket
  8. awk使用的实例
  9. Linux Command Line(II): Intermediate
  10. 2017 ACM/ICPC Asia Regional Shenyang Online spfa+最长路
  11. React Native控件之Listview
  12. HBase案例:HBase 在人工智能场景的使用
  13. Apache2.4反向代理设置
  14. SWT table性能改善 -- 使用VirtualTable
  15. (第十二周)Bug修正报告
  16. 问题:从键盘读取特定类型的数据(使用Scanner读取int类型)
  17. Mac下Jmeter快速安装与入门-模拟测试Post请求及设置Http头
  18. iostat -x命令诊断
  19. C# .net 获取外网ip
  20. Ubuntu安装sublime Text 3并配置可以输入中文

热门文章

  1. App稳定性测试Monkey
  2. 【原创】(十一)Linux内存管理slub分配器
  3. Unittest框架的从零到壹(二)
  4. Jenkins 实现前端自动打包,自动部署代码及邮件提醒功能
  5. 【Luogu P1967】货车运输
  6. python的reduce,map,zip,filter和sorted函数
  7. Unicode和Ascii的区别
  8. Android Binder机制介绍
  9. CSS文字,文本常用样式
  10. linux搭建Git