Last active
December 16, 2015 04:29
-
-
Save stwalkerster/5377346 to your computer and use it in GitHub Desktop.
LCD code for RPi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# mode: 0 = control | |
echo "1" > /sys/devices/virtual/gpio/gpio3/value | |
# 14 15 18 23 24 25 8 7 | |
data=`echo $1 | xxd -b | cut -f 2 -d " "` | |
if [ "$data" = "00001010" ] ; then | |
data="00100000" | |
fi | |
ONPINS="7 8 25 24 23 18 15 14" | |
for p in $ONPINS; do | |
echo ${data:0:1} > /sys/devices/virtual/gpio/gpio$p/value | |
data=${data:1} | |
done | |
echo "0" > /sys/devices/virtual/gpio/gpio2/value | |
#sleep 0.2; | |
echo "1" > /sys/devices/virtual/gpio/gpio2/value | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# mode: 0 = control | |
echo "0" > /sys/devices/virtual/gpio/gpio3/value | |
# 14 15 18 23 24 25 8 7 | |
data=10000000 | |
ONPINS="14 15 18 23 24 25 8 7" | |
for p in $ONPINS; do | |
echo ${data:0:1} > /sys/devices/virtual/gpio/gpio$p/value | |
data=${data:1} | |
done | |
echo "0" > /sys/devices/virtual/gpio/gpio2/value | |
sleep 0.2; | |
echo "1" > /sys/devices/virtual/gpio/gpio2/value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./lcdclear | |
data=`echo $1 | sed "s/\\(.\\)/'\\1 /g"` | |
for x in $data ; do | |
./lcd ${x:1} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment