Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- screen /dev/ttyUSB0 115200 & sleep .5;
- killall screen;
- clear
- echo "Waiting for Button Press..."
- stty raw -echo < /dev/ttyUSB0;
- cat /dev/ttyUSB0|while read line;
- do
- #echo "$line"
- if [[ "$line" == "FFA05F"* ]]
- then
- echo "Off"
- espeak "Off Button Pressed."
- elif [[ "$line" == "FF807F"* ]]
- then
- echo "On"
- espeak "On Button Pressed"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement