Hello everyone,

I use with my PIC a simple NTC thermistor in series with a 2.2k thermistor (to make a voltage divider), then I fed the ADC1 port.
The ADC reading works well, with a 8-bit setting (values from 0 to 255 in function of temperature).

Now I want to convert this number into degrees celcius, so I will use this function :

ADCIN 1,adcVar
ADCVoltage=adcVar/78 (255/3.3=78)
temp=(ADCVoltage-0.8143)/0.0319

But I'm aware that PBP don't handle float numbers. Here's my code :

' Set PORTA to all input
TRISA = %11111111

' Set up ADCON1
ADCON1 = %10000010

define OSC 20
DEFINE ADC_BITS 8 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 10 ' Set sampling time in microseconds
DEFINE LCD_DREG PORTC 'LCD data port
DEFINE LCD_RSREG PORTC 'LCD data port
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4 'LCD bus size 4 or 8
DEFINE LCD_LINES 2 'Number lines on LCD
DEFINE LCD_COMMANDUS 10000'Command delay time in us
DEFINE LCD_DATAUS 1000 'Data delay time in us

adcVar VAR WORD
adcVoltage VAR WORD
temp VAR WORD

Pause 4000
Lcdout "Thermometer"
pause 4000

main:

ADCIN 1,adcVar

ADCVoltage=adcVar/78
temp=(ADCVoltage-0.8143)/0.0319

Pause 100
lcdout $fe,1
lcdout #adcvar
lcdout $fe,$c0
lcdout 1,#temp

GoTo main
I can read correctly ADC value on the LCD display (which changes as function of temperature).

But I like to display on the LCD the temperature with a float number (XX.YY °C).

But I don't know how to proceed. Can you arrange the code for me? Thanks in advance.