spotlight_ctl.sh 415 B

12345678910111213
  1. #!/bin/sh
  2. if [[ "$1" == "on_high" ]]; then
  3. echo -ne "\xaa\x55\x43\x05\x16\xff\x07\x02\x63" > /dev/ttyUSB0
  4. elif [[ "$1" == "on_low" ]]; then
  5. echo -ne "\xaa\x55\x43\x05\x16\x33\x07\x01\x97" > /dev/ttyUSB0
  6. elif [[ "$1" == "off" ]]; then
  7. echo -ne "\xaa\x55\x43\x05\x16\x00\x07\x01\x64" > /dev/ttyUSB0
  8. else
  9. echo "usage: spotlight_ctl on_high"
  10. echo "usage: spotlight_ctl on_low"
  11. echo "usage: spotlight_ctl off"
  12. fi