demo.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /bin/sh
  2. ## run a demo
  3. echo "> starting demo!"
  4. setup () {
  5. sh /root/weather.sh setup
  6. sh /root/timer.sh setup
  7. sh /root/map.sh setup
  8. sh /root/status.sh wifi 1
  9. sh /root/status.sh battery 2
  10. sh /root/status.sh bluetooth 1
  11. }
  12. set_timer () {
  13. sh timer.sh update 1 "13:52"
  14. sh /root/mcu/setButton.sh 0 ff0000
  15. sh /root/mcu/setButton.sh 1 00ff00
  16. sh /root/mcu/setButton.sh 2 0000ff
  17. sh /root/mcu/setButton.sh 3 88ffff
  18. sh /root/select.sh right
  19. sleep 1
  20. sh timer.sh update 1 "13:51"
  21. sleep 1
  22. sh timer.sh update 1 "13:50"
  23. sleep 1
  24. sh timer.sh update 1 "13:49"
  25. sleep 1
  26. sh timer.sh update 1 "13:48"
  27. sleep 1
  28. sh timer.sh update 1 "13:47"
  29. }
  30. set_map () {
  31. sh /root/mcu/setColor.sh 0
  32. sh /root/select.sh right
  33. }
  34. set_reset () {
  35. # sh /root/mcu/setColor.sh 9b4b63
  36. sh /root/mcu/setColor.sh 0
  37. sh /root/select.sh first
  38. }
  39. if [ "$1" == "r" ]; then
  40. set_reset
  41. elif [ "$1" == "s" ]; then
  42. setup
  43. elif [ "$1" == "t" ]; then
  44. set_timer
  45. else
  46. set_reset
  47. sleep 4
  48. set_timer
  49. sleep 1
  50. set_map
  51. sleep 2
  52. fi