Code:
$lib "lcd4busy.lbx" 'ersetzt die Standard LCD Bibliothek
$regfile = "m644def.dat"
$crystal = 8000000
$baud = 19200
Config Lcd = 16 * 2
Const _lcdport = Portc
Const _lcdddr = Ddrc
Const _lcdin = Pinc
Const _lcd_e = 1
Const _lcd_rw = 2
Const _lcd_rs = 3
Dim A As Integer
Dim B As String * 1
Dim Zeile As String * 999
Dim Zeichen As Integer
Dim Fzeichen As Integer
Dim Chapter As Integer
Config Keyboard = Pind.5 , Data = Pind.6 , Keydata = Keydata
Initlcd
Cursor Off Noblink
Cls
Config Pind.7 = Output
Portd.7 = 1 'Beleuchtung
Zeile = ""
A = 0
B = ""
Zeichen = 0
Cursor On Noblink
Do
A = Getatkbd()
If A > 0 And A <> 7 And A <> 42 And A <> 8 Then
Cls
If A = 121 Then
A = 122
Elseif A = 122 Then
A = 121
End If
B = Chr(a)
Zeile = Zeile + B
End If
If A = 42 Then
Cursor Off Noblink
Chapter = 16
Do
A = Getatkbd()
If A = 54 Then Chapter = Chapter + 5
If A = 52 And Chapter > 16 Then Chapter = Chapter -5
Locate 1 , 1
Lcd Left(zeile , Chapter)
Loop Until A = 13
Cls
Lcd "Wait..."
Waitms 100
Cls
A = 0
Cursor On Noblink
End If
If A = 7 Then
Cls
Zeile = ""
End If
If A = 8 Then
Zeichen = Len(zeile) - 1
Zeile = Left(zeile , Zeichen)
Cls
End If
Locate 2 , 1
Fzeichen = 999 - Len(zeile)
Lcd "F. Zeichen:" ; Fzeichen
Locate 1 , 1
If Len(zeile) > 16 Then Lcd Right(zeile , 15)
If Len(zeile) <= 16 Then Lcd Zeile
Loop
Keydata:
' Shift-Taste nicht gedrückt
Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , &H5E , 0
Data 0 , 0 , 0 , 0 , 0 , 113 , 49 , 0 , 0 , 0 , 122 , 115 , 97 , 119 , 50 , 0
Data 0 , 99 , 120 , 100 , 101 , 52 , 51 , 0 , 0 , 32 , 118 , 102 , 116 , 114 , 53 , 0
Data 0 , 110 , 98 , 104 , 103 , 121 , 54 , 7 , 8 , 44 , 109 , 106 , 117 , 55 , 56 , 0
Data 0 , 44 , 107 , 105 , 111 , 48 , 57 , 0 , 0 , 46 , 45 , 108 , 48 , 112 , 43 , 0
Data 0 , 0 , 0 , 0 , 0 , 92 , 0 , 0 , 0 , 0 , 13 , 0 , 0 , 92 , 0 , 0
Data 0 , 60 , 0 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0
Data 48 , 44 , 50 , 53 , 54 , 56 , 0 , 0 , 0 , 43 , 51 , 45 , 42 , 57 , 0 , 0
' Shift-Taste gedrückt
Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
Data 0 , 0 , 0 , 0 , 0 , 81 , 33 , 0 , 0 , 0 , 90 , 83 , 65 , 87 , 34 , 0
Data 0 , 67 , 88 , 68 , 69 , 0 , 35 , 0 , 0 , 32 , 86 , 70 , 84 , 82 , 37 , 0
Data 0 , 78 , 66 , 72 , 71 , 89 , 38 , 0 , 0 , 76 , 77 , 74 , 85 , 47 , 40 , 0
Data 0 , 59 , 75 , 73 , 79 , 61 , 41 , 0 , 0 , 58 , 95 , 76 , 48 , 80 , 63 , 0
Data 0 , 0 , 0 , 0 , 0 , 96 , 0 , 0 , 0 , 0 , 13 , 94 , 0 , 42 , 0 , 0
Data 0 , 62 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0 , 0
Data 48 , 44 , 50 , 53 , 54 , 56 , 0 , 0 , 0 , 43 , 51 , 45 , 42 , 57 , 0 , 0
Lesezeichen