ds18b20 to lcd

HAZELEB

Member
Hi There
My project for three ADC inputs LDR for day & night & two pot`s for day & night temp using the ds18b20. I used the FRM010 serial LCD firmware to send the temp reading out to the display and I have that all working. However I have now connected the LCD direct to the picaxe 18A.Have managed to initialise the LCD but I just can’t get my head around sending the temp reading to the display any help would be appreciated
 

BeanieBots

Moderator
Not sure exactly which bit you are having the problem with but would guess that you were using feature of adding # to the variable name to get the data to display in ascii. If this is the case, then try ading "0" (b0=b0+"0") to convert to ascii.
 

HAZELEB

Member
Hi Beaniebots

I’m a new comer to picaxe and programming. Now the bit I’m having the problem with is sending the temperature to the LCD.I used b3 for the readtemp.

DisplayTopline:

EEPROM 6,(“Temperature”)

FOR B11=6 TO 11
READ B11,byte
GOSUB SendDataByte

MoveCursorToStartOfSecondLine:

Byte=$CO
GOSUB SendCmdByte

The program works fine to here.
--------------------------------
----------------------------------

DisplayBottomLine:

Now what do I put here to send the temp to the LCD?

Many thanks

Hazeleb


 

BeanieBots

Moderator
Without knowing what or how your sub routines work, I would suggest something along these lines.
Assuming you have not already used b4 and that b3 holds a valid positive (worry about negatives later) temperature reading.

b4=b3/10 'get tens of degrees
byte=b4+"0" 'add "0" to convert to ASCII value
GOSUB SendDataByte 'send it to LCD
b4=b3//10 'get the units value (see let command)
byte=b4+"0" convert to ASCII
GOSUB SendDataByte 'send it to LCD

Try that and see if you get the desired result. I don't know which varibles you have used within the subroutines so b4 might not be spare. If you have already used it, then pick another one.
 
Top