http://www.sfcompiler.co.uk/wiki/pmwiki ... er.ModulesJason wrote:Hey Mast,
Where did you get that GLCD_192x94.bas file from?
and what glcd screen are you using with this code?
Thanks in advance
Jason
Dallas 18B20 example
Moderators: David Barker, Jerry Messina
Hi, Sorry about the delay, but here is the code I used and it worked great.
If you had 5, 10 or 20 sensors connected to the bus, they would display each sensors temp on screen along with its hex address in 1 second rolling screen updates.
The resolution was to 3 decimal places I think, or 4 maybe. I haven't used it for a while. The company I work for had a contract to check a heap of incubators, but after about a year, the contract was tendered out to another company who must have undercut our price. Otherwise the thing worked perfect.
Hope it helps you in your project
If you had 5, 10 or 20 sensors connected to the bus, they would display each sensors temp on screen along with its hex address in 1 second rolling screen updates.
The resolution was to 3 decimal places I think, or 4 maybe. I haven't used it for a while. The company I work for had a contract to check a heap of incubators, but after about a year, the contract was tendered out to another company who must have undercut our price. Otherwise the thing worked perfect.
Hope it helps you in your project
Code: Select all
Device = 18F252
Clock = 20
#option LCD_DATA = PORTC.4
#option LCD_RS = PORTC.3
#option LCD_EN = PORTC.2
// import modules...
Include "DS18B20.bas"
Include "convert.bas"
Include "lcd.bas"
// on display temperature event...
Event OnDisplayTemp()
Dim TempA As ShortInt
Dim TempB As Word
Dim Index As Byte
Dim index2 As Byte
RomID = SearchRomID
GetTemp(TempA, TempB)
LCD.WriteAt(1,1,DecToStr(TempA),".",DecToStr(TempB,4),"C")
// display ROM ID...
LCD.WriteAt(2,1,"($")
Index = 6
index2 = 3
Repeat
LCD.WriteAt(2,index2,HexToStr(SearchRomID(Index),2))
Dec(Index)
index2 = (index2)+2
DelayMS(100)
Until Index = 0
LCD.WriteAt(2,16,")")
DelayMS(500)
End Event
DelayMS(150)
LCD.Cls
// program start...
SetPin(PORTC.0)
// if we have some DS1820 devices connected to the bus,
// then display temperature for each one...
If Count > 0 Then
While true
ConvertAll
FindAll(OnDisplayTemp)
DelayMS(1000)
Wend
EndIf