$regfile = "m8def.dat" ' Controllerauswahl $crystal = 1000000 '$crystal = 16 000 000 'Quarzfrequenz '$baud = 9600 'Baudrate für RS232-Schnitstelle ' 'Pins (Port B) für LCD-Modul definieren 'Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portb.4 , Rs = Portb.5 'Config Lcd = 16 * 1a 'LCD-Modul 1x16 Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2 Config Lcdbus = 4 'Config Portb = Output Config Portd = Output Deflcdchar 0 , 6 , 9 , 9 , 6 , 32 , 32 , 32 , 32 ' LCD-Sonderzeichen 'Pins von Port C definieren Config Portc = Input 'PinC.0=Taster3, PinC1=Taster4, PinC.2=IR-Empfänger, PinC.3=Poti Wait 100 Portc = &H00 'pullup Ausschalten 'Pins für I2C-Bus definieren 'Config Sda = Portc.4 'Config Scl = Portc.5 'AD-Wandler definieren Config Adc = Single , Prescaler = Auto , Reference = Internal 'Einzelmessung und Referenzspannung 2.56 Volt Deflcdchar 0 , 6 , 9 , 9 , 6 , 32 , 32 , 32 , 32 '° Zeichen Start Adc Dim W As Word Dim V As Single Dim Wert As Word Cursor Off Const Refer = 1.1593 'Fühler Konstante bei 0°C muss mit Eiswasser abgegliechen 'werden Cls Do W = Getadc(5) V = W * 0.0025 '2.56/1024 = 0.0025 Volt 10 Bit AD converter V = V - Refer V = V / 0.0077125 ' 0.0077125 fühler konstante pro grad °C 'V = V + 2 '2te möglichkeit den fühler abzugleichen Cls Lcd Fusing(v , "#.#") ; Chr(0) ; "C" ; W Wait 3 Loop