Added lcd function thing for arduino-lcd-writer
This commit is contained in:
parent
527329e8d8
commit
10812db535
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Temperature printing function
|
||||
print_temp(){
|
||||
temp="CPU: $(sensors | grep 'Tccd1' | awk '{print substr($2, 2)}')?GPU: $(sensors | grep "edge" | awk '{print substr($2, 2)}')"
|
||||
echo "$temp"
|
||||
}
|
||||
|
||||
# The device should be set with the LCD_SERIAL_DEVICE environment variable
|
||||
# Sets the baud to 115200 which is what the arduino is set to communicate on
|
||||
#stty -F $LCD_SERIAL_DEVICE 115200
|
||||
|
||||
# make reset to set up all the options for serial correctly
|
||||
cd $LCD_PROGRAM_LOCATION && make reset && cd ~
|
||||
|
||||
# Leave a process running in the background that keeps the serial connection alive
|
||||
tail -f $LCD_SERIAL_DEVICE > /dev/null &
|
||||
|
||||
sleep 1
|
||||
# Update the temps once per second
|
||||
while true
|
||||
do
|
||||
echo "CPU: $(sensors | grep 'Tccd1' | awk '{print substr($2, 2)}')?GPU: $(sensors | grep "edge" | awk '{print substr($2, 2)}')" | awk '{ gsub("\xc2\xb0", "\xdf", $0); print }' > $LCD_SERIAL_DEVICE
|
||||
sleep 5
|
||||
done
|
Loading…
Reference in New Issue