Device = 18F452
Clock = 20
// import modules...
Include "DS18B20.bas"
Include "convert.bas"
Include "LCD.bas"
///
#option LCD_DATA = PORTD.4 // Assign the LCD connections
#option LCD_EN = PORTD.3 //
#option LCD_RS = PORTD.2 //
// working variables...
Dim
TempA(3) As ShortInt,
TempB(3) As Word,
LED(7)As Word,
Port RA.0 As LED(0), // HIGH = RED leds , LOW = GREEN leds
Port RA.1 As LED(1), //
Port RA.2 As LED(2), //
Port RA.3 As LED(3) // ############################
// Start Of Program...
SetBaudrate(br19200)
SetPin(PORTC.0) // temp probes connect
// Find() will search the bus for a single DS1820 device
// and load its ROM ID into the DS1820 public variable RomID - you
// could do this manually. For example, RomID = MyRomID...
If DS18B20.Find Then
While true
Convert
GetTemp(TempA(), TempB())
LCD.WriteAt(1,1,"WALK IN COOLER")(DecToStr(TempA(0)),".",DecToStr(TempB(0),4), " C", 13, 10) // Send some text to the LCD
LCD.WriteAt(1,2,"GLASS DOOR COOLER")(DecToStr(TempA(1)),".",DecToStr(TempB(1),4), " C", 13, 10) // Send some text to the LCD
LCD.WriteAt(1,3,"METAL DOOR COOLER")(DecToStr(TempA(2)),".",DecToStr(TempB(2),4), " C", 13, 10) // Send some text to the LCD
LCD.WriteAt(1,4,"KoC BEER COOLER") (DecToStr(TempA(3)),".",DecToStr(TempB(3),4), " C", 13, 10) // Send some text to the LCD
DelayMS(1000)
Wend
Else