#!/bin/bash
temp=`sudo /home/pi/BMP085-2/readBMP085 -t` → この部分はお使いの温度計センサーに合せて変更してください。
#整数値に変換
itemp=`echo $temp |cut -d. -f1`
tlen=${#temp}
if [ $tlen -eq 3 ];then
temp=" "$temp
fi
temp=$temp"℃"
#温度に応じて文字の色を決定
if [ $itemp -le 0 ]; then
color="darkblue"
elif [ $itemp -le 10 ]; then
color="blue"
elif [ $itemp -le 20 ]; then
color="green"
elif [ $itemp -le 30 ]; then
color="orange"
else
color="red"
fi
convert -font
/usr/share/fonts/truetype/kochi/kochi-mincho.ttf
-pointsize 50 -fill "blue" -draw "text 50,80 '現在の室外温度'"
/home/pi/frame0001.jpg /tmp/out1.jpg
convert -font
/usr/share/fonts/truetype/kochi/kochi-mincho.ttf
-pointsize 130 -fill "${color}" -draw "text 50,250
'$temp'" /tmp/out1.jpg /tmp/out2.jpg
if [ ! -e
/home/pi/google_drive/Raspberry ]; then
mkdir /home/pi/google_drive/Raspberry
fi
#cp /tmp/out2.jpg /home/pi/google_drive/Raspberry/
#cd /home/pi/google_drive/
#./grive 2> /tmp/google_drive.log
/home/pi/Dropbox-Uploader/dropbox_uploader.sh upload
/tmp/out2.jpg out2.jpg > /tmp/dropbox.log
|