#!/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
|