20x2 LED temperature 4digit 7 segment Celsius
Updated program
Uses the ds18b20
will display the range of -55.0c Celsius
to
99.9c Celsius
if outside this range displays FFFF
uses owin command
but anyone could use the convert code on readtemp12 command on any pic
updates every 6 secs.
Updated program
Uses the ds18b20
will display the range of -55.0c Celsius
to
99.9c Celsius
if outside this range displays FFFF
uses owin command
but anyone could use the convert code on readtemp12 command on any pic
updates every 6 secs.
Code:
' -- -- -- --
'B.0-A | | | | Picake 20x2 ver C.0
'B.1-B
'B.2-C | | | | marks
'B.3-D -- -- -- -- -- -- -- --
'B.4-E | | | |
'B.5-F
'B.6-G | | | |
'B.7-dp -- -- -- -- o -- --
'
'Display 1 2 3 4
'Common anode C.3 C.2 C.1 c.0
eeprom 0,(192,249,164,176,153,146,130,248,128,144,255) 'Display (0,1,2,3,4,5,6,7,8,9,blank)
main:
let dirsb = %11111111
let dirsc = %00111111
temp:
owout c.7,%1001,($CC,$44) 'reset(send skip rom ,send convert t)
pinsb=142 'Display FFFF if not within valid range
owout c.7,%0001,($CC,$BE) 'reset(send skip rom ,send read lsb msb)
owin c.7,%0000,(b2,b3) 'read in result ds18b20
' info +125 degrees / 0.0625 = 2000
IF W1 > 1599 AND W1 < 64656 THEN temp ' skip if not within valid sensor range -55.0c to 99.9c
b19 = 167 'Display temp positive degrees -c
IF W1 > 64655 THEN ' info - 55 degrees = 64656
b19 = 166 'Display temp negative degrees -c
W1 = - W1
ENDIF
W1 = W1 * 5 / 8 ' info + ie w1=850 display 85.0c
' info if - ie w1=100 display 10.0 -c
let dirsb = %11111111 'restore b pins after read
display:
for w15=1 to 400 'Temperaturedisplay time(6secs then updates)
b0=10 : if w1 < 100 then dig1 'Display1 zero blanking
let b0 = w1 dig 2
Dig1: read b0,b16
let pinsb = b16 : low c.3 : pause 1 : high c.3 'Display1 temp
let b0 = w1 dig 1
Dig2: read b0,b17 let b17=b17-128 'Display2 d.p
let pinsb = b17 : low c.2 : pause 1 : high c.2 'Display2 temp
let b0 = w1 dig 0
Dig3: read b0,b18
let pinsb = b18 : low c.1 : pause 1 : high c.1 'Display3 temp
'
Dig4: let pinsb = b19 : low c.0 : pause 1 : high c.0 'Display4 c
next w15
goto temp
Attachments
-
188.8 KB Views: 75
Last edited: