Advertisement
metalx1000

IR Serial Port Reader Arduino

Dec 4th, 2017
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. screen /dev/ttyUSB0 115200 & sleep .5; 
  4. killall screen;
  5. clear
  6.  
  7. echo "Waiting for Button Press..."
  8. stty raw -echo < /dev/ttyUSB0;
  9. cat /dev/ttyUSB0|while read line;
  10. do
  11.   #echo "$line"
  12.   if [[ "$line" == "FFA05F"* ]]
  13.   then
  14.     echo "Off"
  15.     espeak "Off Button Pressed."
  16.   elif [[ "$line" == "FF807F"* ]]
  17.   then
  18.     echo "On"
  19.     espeak "On Button Pressed"
  20.   fi
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement