'*************************** ATmega8 AVR ************************
$regfile = "m8def.dat"                  ' chip
$crystal = 8000000                      ' frekvencia
Config Portb.0 = Input                  ' S0
Config Portb.1 = Input                  ' S1            LED = PORTD.7
Config Portb.2 = Input                  ' S2
Config Portb.3 = Input                  ' MOSI
Config Portb.4 = Output                 ' LCD LED @ MISO
Config Portb.5 = Input                  ' SCK
Config Portb.6 = Output                 ' DIGIT0
Config Portb.7 = Output                 ' DIGIT1
Config Portc = Input                    ' ADC
Config Portd = Output                   ' LCD / LED
Portb.0 = 1                             ' pull up resistors enabled
Portb.1 = 1                             ' pull up resistors enabled
Portb.2 = 1                             ' pull up resistors enabled
portb.4 = 1
Config Int0 = Rising
On Int0 Vektor
Config Adc = Single , Prescaler = Auto
Start Adc
'************************** CONFIGURATION ***********************
Dim A As Integer
Main:
Cls
Cursor Off
Lcd "  H"
Lcd Chr(148)
Lcd "m"
Lcd Chr(130)
Lcd "rs"
Lcd Chr(130)
Lcd "klet:"
Do
A = Getadc(0)
A = A / 10
A = 90 - A				' növekvo homérsékletre az "A"s értéke növekszik
Locate 2 , 5
Lcd "+"
Lcd A
Lcd " "
Lcd Chr(178)
Lcd "C       "
Loop
'************************ MAIN PROGRAM **************************
End