单片机/MCUwilliam hill官网
直播中

嵌入式小能手

1年用户 756经验值
擅长:嵌入式技术
私信 关注
[文章]

嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-提示程序之背光脚本测试

backlight.sh:
  1. #! /bin/bash
  2. echo -e "\033[36m-----------BACKLIGHT--------------\033[0m"
  3. echo -e "\033[1;32mPress Esc to turn off the backlight\033[0m"
  4. ./continue.sh
  5. echo 0 > /sys/class/backlight/backlight/brightness
  6. echo -e "\033[1;32mPress Esc to turn on the backlight\033[0m"
  7. ./continue.sh
  8. echo 6 > /sys/class/backlight/backlight/brightness
  9. echo "Please enter y/n"
  10. read -sn 1 read_check
  11. if [ ! -n $read_check ]
  12. then
  13.         exit 0
  14. elif [ "$read_check" = "y" ]
  15. then
  16.         echo -e "\033[1;32mBACKLIGHT OK\033[0m"
  17. else
  18.         echo -e "\033[1;31mBACKLIGHT ERR\033[0m"
  19. fi
  1. root@ELF1:~# chmod 777 backlight.sh
  2. root@ELF1:~# ./backlight.sh
4-1.png

更多回帖

发帖
×
20
完善资料,
赚取积分