MrDEB
Well-Known Member
Finally getting back to this project.
Started hacking at the code but wondering where to put the math computations discussed at the beginning of this subject?
Tf=(9xTc / 5 + 32 something to do with floating integers?
Another question is TEMP A and TEMP B variables. I have TEMP A() TEMP B()
Not sure how to access different temp inputs
Need to add the LED sequence (if cooler is too cold , GREEN LED to flash. Too warm RED LED to flash.
planning on making ports HIGH, LOW, or HIGH Impedance (have two LEDs 1GREEN & 1RED per port )
as for ROMID #'s going to just breadboard the probes then warm each seperatly to indicate then number each temp probe then install into application.
Started hacking at the code but wondering where to put the math computations discussed at the beginning of this subject?
Tf=(9xTc / 5 + 32 something to do with floating integers?
Another question is TEMP A and TEMP B variables. I have TEMP A() TEMP B()
Not sure how to access different temp inputs
Need to add the LED sequence (if cooler is too cold , GREEN LED to flash. Too warm RED LED to flash.
planning on making ports HIGH, LOW, or HIGH Impedance (have two LEDs 1GREEN & 1RED per port )
as for ROMID #'s going to just breadboard the probes then warm each seperatly to indicate then number each temp probe then install into application.
Code:
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