$regfile = "m8def.dat" $crystal = 8000000 $framesize = 16 $hwstack = 30 $swstack = 30 Dim Temperatur As Single Dim Messwert As Word Dim Kelvin As Single Dim Celsius As String * 9 Const Adc_multi = 0.48828125 ' = 5.0 / 1024.0*100 Kopfrechnen spart Code! Const Correct = 273.15 ' Konstante für Umrechnung Kelvin nach Celsius Config Adc = Single , Prescaler = Auto , Reference = Avcc Start Adc 'Hautprogramm '------------ Messwert = Getadc(0) Kelvin = Messwert * Adc_multi Temperatur = Kelvin - Correct ' Die Variable Temperatur enthält die richtige Temperatur Celsius = Str(temperatur) ' Hier wird auf eine Nachkommastelle gekürzt. Fusing und Format haben nicht funktioniert. Celsius = Left(celsius , 4) ' Warscheinlich habe ich nicht die aktuelle Basconversion '------------------ 'Ende Hauptprogramm '------------------