Difference between revisions of "Blog 06"
Jump to navigation
Jump to search
(In this text harry makes a combination from the timer and the temperature visible) |
(→!BETA!) |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== !BETA! == |
== !BETA! == |
||
Now we will also add the time under the temperature: |
Now we will also add the time([[blog 04]]) under the temperature([[blog 05]]): |
||
For this we will combine the codes together. |
|||
For making this I used the previous timer script. |
|||
Where we remove some information |
|||
On the top we put the temperature: 11:00b ( 00 for the first row 11 for display ) |
|||
The is connected with the code of; ./showtemp. |
|||
and on the second row the timer. ( 11:20b ) |
and on the second row the timer. ( 11:20b ) |
||
Where I just used +%H:%M:%S. I could also just use ./Timer, but if I do that I have to remove the load averages of the script. |
|||
I made a new folder called: Koekje |
|||
+ with all the files referencing: Koekje. |
|||
The name I gave this script is TimeTemp: |
|||
#!/bin/bash |
#!/bin/bash |
||
# What display to use: |
# What display to use: |
||
DISP="bw_tool -I -D /dev/i2c-1 -a 94" |
|||
# e.g. for SPI use: |
# e.g. for SPI use: |
||
#DISPL="bw_tool -D /dev/spidev1.0 -a 94" |
#DISPL="bw_tool -D /dev/spidev1.0 -a 94" |
||
#clean the display |
#clean the display |
||
$ |
$DISP -W 10:0:b |
||
while true; do |
while true; do |
||
#get cpu loads |
|||
load=`cut -d' ' -f-3 /proc/loadavg` |
|||
#show temperature |
#show temperature |
||
$ |
$DISP -W 11:00:b |
||
$ |
$DISP -t "temp: "`./showtemp` |
||
#print the current time |
#print the current time |
||
$ |
$DISP -W 11:20:b |
||
$ |
$DISP -t `date +%H:%M:%S` |
||
#idle for 5 seconds |
#idle for 5 seconds |
||
sleep 5 |
sleep 5 |
||
| Line 35: | Line 35: | ||
done |
done |
||
./TimeTemp |
|||
The result: |
|||
| ⚫ | |||
* |
|||
./Koekje |
|||
On [[Blog 07]] I am going to use the buttons to print text on the display. |
|||
| ⚫ | |||
Latest revision as of 13:16, 16 September 2015
!BETA!
Now we will also add the time(blog 04) under the temperature(blog 05): For this we will combine the codes together. For making this I used the previous timer script. Where we remove some information On the top we put the temperature: 11:00b ( 00 for the first row 11 for display ) The is connected with the code of; ./showtemp. and on the second row the timer. ( 11:20b ) Where I just used +%H:%M:%S. I could also just use ./Timer, but if I do that I have to remove the load averages of the script.
The name I gave this script is TimeTemp:
#!/bin/bash
# What display to use:
DISP="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISP -W 10:0:b
while true; do
#show temperature
$DISP -W 11:00:b
$DISP -t "temp: "`./showtemp`
#print the current time
$DISP -W 11:20:b
$DISP -t `date +%H:%M:%S`
#idle for 5 seconds
sleep 5
done
./TimeTemp
The result:
On Blog 07 I am going to use the buttons to print text on the display.