Difference between revisions of "Blog 06"

From BitWizard WIKI
Jump to: navigation, search
(!BETA!)
(!BETA!)
 
(One intermediate revision 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 this we will combine the codes together.  
 
For making this I used the previous timer script.
 
For making this I used the previous timer script.
Line 8: Line 8:
 
The is connected with the code of; ./showtemp.  
 
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.  
+
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.  
  
  

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:

This picture was taken on the same moment it changed from time

On Blog 07 I am going to use the buttons to print text on the display.