Hier die relevanten Auszüge:
Code:
$regfile = "m16def.dat" 'Mega16
$crystal = 12000000 '12 MHz
Dim Timervorgabe As Word 'Preload für Sekundentakt
Readeeprom Timervorgabe , 106 'ist abgelegt im EEPROM
If Timervorgabe > 30000 Then Timervorgabe = 18661 'wenn nicht im EEPROM programmiert, dann errechneten Wert nehmen
Readeeprom Minhell , 2
Readeeprom Maxhell , 4
Readeeprom Schwellwert , 6
Do
Gosub Getir
If Command = 0 Then Return
If Command = 1 Then
Pwmmax = A
Writeeeprom Pwmmax , 100
End If
If Command = 7 Then A = A - 5
If Command = 9 Then A = A + 5
If A < 0 Then A = 0
If A > 250 Then A = 250
Ocr2 = A
Upperline
Lcd A ; " "
Loop
Gosub Getir
If Command = 0 Then Return
If Command = 1 Then
Minhell = B
Writeeeprom Minhell , 2
End If
Gosub Getir
If Command = 0 Then Return
If Command = 1 Then
Maxhell = B
Writeeeprom Maxhell , 4
End If
Gosub Getir
If Command = 0 Then Return
If Command = 1 Then
Schwellwert = B
Writeeeprom Schwellwert , 6
End If
Timervorgabe = C
Writeeeprom Timervorgabe , 106
Alle Variablen sind Byte außer Timervorgabe ist Word
Lesezeichen