Hallo JeyBee,
ich habe da noch einen kleinen Fehler in der Rechnung. Das sollte jetzt funktionieren.
$regfile "m48def.dat"
$crystal = 8000000
Config Pinc.4 = Input
Portc.4 = 0
Config Portb = Output
Config Portd = Output
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.5 , Db6 = Portb.7 , Db7 = Portb.6 , E = Portd.7 , Rs = Portb.0
Config Lcd = 16 * 2
Config Adc = Single , Prescaler = Auto
Config Portc.0 = Input
Dim W As Word
Dim Z1 As Single
Dim Temp As Single
Do
Portb.1 = 1
W = Getadc(2)
Z1 = W
Z1 = Z1 - 786
Temp = Z1 * 0.189
Temp = Temp + 25
Cls
Locate 1 . 1
Lcd Temp
Locate 2 . 1
Lcd W
Waitms 300
Loop
Lesezeichen