Bascom

Tekst pisany nastawnikiem kodu BCD

Program pokazuje, jak przy pomocy nastawnika kodu BCD można wpisać bezpośrednio do procesora tekst w postaci liter, cyfr i innych znaków. Wpisany tekst jest zapamiętany w pamięci Eprom i pozostaje w procesorze nawet po wyłączeniu napięcia. Zapisany tekst można wykorzystywać do różnych celów, np jako komunikat itp.

'BCDbity9.bas

'Tekst napisany nastawnikiem kodu BCD, cyfry na znaki z kodu ASCI.

'Tutaj 72 znaki.

'Tekst można czytać na Lcd lub przetwarzać w dowolny sposób.

'BCDbity9.png

'Opracował Henryk Wydmuch.

'Pamięć zajęta w 71%.

'Fusebit ustawiony na 0011, czyli wewnętrzny generator RC 4MHz.

 

$regfile = "m8def.dat"                                      'Info dla kompilatora.

$crystal = 4000000                                          'Informujemy kompilator o frekwencji 4MHz.

 

 Config Lcd = 16 * 2                                        'Konfiguracja Lcd.

 Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5

 

 'Porty obciążone są rezystorami do masy.

 Config Pind.0 = Input                                      'Wejście informacji BCD I.

 Config Pind.1 = Input                                      'Wejście informacji BCD H.

 Config Pind.2 = Input                                      'Wejście informacji BCD G.

 Config Pind.3 = Input                                      'Wejście informacji BCD F.

 Config Pind.4 = Input                                      'Wejście informacji BCD E.

 Config Pind.5 = Input                                      'Wejście informacji BCD B.

 Config Pind.6 = Input                                      'Wejście informacji BCD C.

 Config Pind.7 = Input                                      'Wejście informacji BCD D.

 Config Pinb.0 = Input                                      'Wejście informacji BCD A.

 

 Config Pinb.1 = Input                                      'Port do czytania z pamięci Eprom.

 Config Pinb.2 = Input                                      'Port do kasowania pamięci Eprom.

 Config Pinb.3 = Input                                      'Przycisk zapisu znaku.

 Set Portb.1                                                '

 Set Portb.2                                                '

 Set Portb.3                                                '

 

 Dim Zlicz As Byte                                          'Zmienna zliczająca kolejność nastawy liter.

 Dim Suma As Word                                           'Zsumowana liczba kodów BCD.

 Dim Wyn As Word                                            'Zsumowana liczba kodów BCD.

 Dim Text As String * 128                                   '

 Dim Slowo As String * 32                                   '

 Dim Slowo1 As String * 32                                  '

 Dim Slowo2 As String * 32                                  '

 Dim Slowo3 As String * 32                                  '

 Dim Slowo4 As String * 32                                  '

 

 Dim Cy1 As String * 1                                      'Poszczególne litery.

 Dim Cy2 As String * 1                                      '

 Dim Cy3 As String * 1                                      '

 Dim Cy4 As String * 1                                      '

 Dim Cy5 As String * 1                                      'Poszczególne litery.

 Dim Cy6 As String * 1                                      '

 Dim Cy7 As String * 1                                      '

 Dim Cy8 As String * 1                                      'Poszczególne litery.

 Dim Cy9 As String * 1                                      '

 Dim Cy10 As String * 1                                     '

 Dim Cy11 As String * 1                                     'Poszczególne litery.

 Dim Cy12 As String * 1                                     '

 Dim Cy13 As String * 1                                     '

 Dim Cy14 As String * 1                                     '

 Dim Cy15 As String * 1                                     '

 Dim Cy16 As String * 1                                     '

 Dim Cy As String * 1                                       '

 

 I Alias Pind.0                                             'Pind.0 będzie się nazywał I.

 H Alias Pind.1                                             'Pind.1 będzie się nazywał H.

 G Alias Pind.2                                             'Pind.2 będzie się nazywał G.

 F Alias Pind.3                                             'Pind.3 będzie się nazywał F.

 E Alias Pind.4                                             'Pind.0 będzie się nazywał E.

 D Alias Pind.7                                             'Pind.1 będzie się nazywał D.

 C Alias Pind.6                                             'Pind.2 będzie się nazywał C.

 B Alias Pind.5                                             'Pind.3 będzie się nazywał B.

 A Alias Pinb.0                                             'Pind.0 będzie się nazywał A.

 

 

 Dim Ik As Byte                                             'Zmienne zawierające liczby poszczególnych kodów BCD.

 Dim Hk As Byte                                             '

 Dim Gk As Byte                                             '

 Dim Fk As Byte                                             '

 Dim Ek As Byte                                             '

 Dim Dk As Byte                                             '

 Dim Ck As Byte                                             '

 Dim Bk As Byte                                             '

 Dim Ak As Byte                                             '

 

 Cls                                                        'Czyść.

 Lcd "Tekst pisany ";                                       '

 Lowerline                                                  '

 Lcd "nastawn.kodu BCD";                                    '

 Wait 10                                                    'Trzymaj komunikat 10sek.

 Cls                                                        'Czyść.

 

 '--------------------

  Do                                                        'Pętla.

    If Pinb.3 = 0 Then                                      'Przycisk, podaje impuls do Portb.3.

    Incr Zlicz                                              'Powiększaj zmienną.

    Waitms 200                                              ' Po impulsie poczekaj.

 

   If I = 0 Then                                            'Jeśli kod I BCD nie jest nastawiony, ma 0...

    Ik = 0                                                  'Zmienna zawiera 0.

    Else                                                    'w przeciwnym razie...

    Ik = 100                                                'Zmienna zawiera 100.

    End If                                                  '

 

    If H = 0 Then                                           '

    Hk = 0                                                  '

    Else                                                    '

    Hk = 80                                                 '

    End If                                                  '

 

    If G = 0 Then                                           '

    Gk = 0                                                  '

    Else                                                    '

    Gk = 40                                                 '

    End If                                                  '

 

    If F = 0 Then                                           '

    Fk = 0                                                  '

    Else                                                    '

    Fk = 20                                                 '

    End If                                                  '

 

    If E = 0 Then                                           '

    Ek = 0                                                  '

    Else                                                    '

    Ek = 10                                                 '

    End If                                                  '

 

    If D = 0 Then                                           '

    Dk = 0                                                  '

    Else                                                    '

    Dk = 8                                                  '

    End If                                                  '

 

    If C = 0 Then                                           '

    Ck = 0                                                  '

    Else                                                    '

    Ck = 4                                                  '

    End If                                                  '

 

    If B = 0 Then                                           '

    Bk = 0                                                  '

    Else                                                    '

    Bk = 2                                                  '

    End If                                                  '

 

     If A = 0 Then                                          '

    Ak = 0                                                  '

    Else                                                    '

    Ak = 1                                                  '

    End If                                                  '

 

    Suma = Suma + Ak                                        'Zmienna Suma zawiera 0 + zmienna Ak.

    Suma = Suma + Bk                                        'Zmienna Suma zawiera Ak + zmienna Bk.

    Suma = Suma + Ck                                        '

    Suma = Suma + Dk                                        '

    Suma = Suma + Ek                                        '

    Suma = Suma + Fk                                        '

    Suma = Suma + Gk                                        '

    Suma = Suma + Hk                                        '

    Suma = Suma + Ik                                        '

    Wyn = Suma                                              'Dwie zmienne zawierają to samo.

'-----------

  Select Case Zlicz                                         'Przeglądaj zmienną kroczącą Zlicz.

 

 Case 1 : Cy1 = Chr(wyn)                                    'Pierwszy krok, do Cy1 wpisz słowo z cyfry w zmiennej Wyn.

 Cls                                                        '

 Locate 1 , 1                                               'Piszemy w pierwszej linii.

 Lcd Cy1                                                    'Pokaż tę literę lub cyfrę z kodu Asci.

 

 Case 2 : Cy2 = Chr(wyn)

 Locate 1 , 2                                               '

 Lcd Cy2                                                    '

 

 Case 3 : Cy3 = Chr(wyn)                                    '

 Locate 1 , 3                                               '

 Lcd Cy3                                                    '

 

 Case 4 : Cy4 = Chr(wyn)                                    '

 Locate 1 , 4                                               '

 Lcd Cy4                                                    '

 

 Case 5 : Cy5 = Chr(wyn)                                    '

 Locate 1 , 5                                               '

 Lcd Cy5                                                    '

 

 Case 6 : Cy6 = Chr(wyn)                                    '

 Locate 1 , 6                                               '

 Lcd Cy6                                                    '

 

 Case 7 : Cy7 = Chr(wyn)                                    '

 Locate 1 , 7                                               '

 Lcd Cy7                                                    '

 

 Case 8 : Cy8 = Chr(wyn)                                    '

 Locate 1 , 8                                               '

 Lcd Cy8                                                    '

 

 Case 9 : Cy9 = Chr(wyn)                                    '

 Locate 1 , 9                                               '

 Lcd Cy9                                                    '

 

 Case 10 : Cy10 = Chr(wyn)                                  '

 Locate 1 , 10                                              '

 Lcd Cy10                                                   '

 

 Case 11 : Cy11 = Chr(wyn)                                  '

 Locate 1 , 11                                              '

 Lcd Cy11                                                   '

 

 Case 12 : Cy12 = Chr(wyn)                                  '

 Locate 1 , 12                                              '

 Lcd Cy12                                                   '

 

 Case 13 : Cy13 = Chr(wyn)                                  '

 Locate 1 , 13                                              '

 Lcd Cy13                                                   '

                                                            '

 Case 14 : Cy14 = Chr(wyn)                                  '

 Locate 1 , 14                                              '

 Lcd Cy14                                                   '

 

 Case 15 : Cy15 = Chr(wyn)                                  '

 Locate 1 , 15                                              '

 Lcd Cy15                                                   '

 

 Case 16 : Cy16 = Chr(wyn)                                  'Pierwsza linia Lcd zapełniona

 Slowo = Cy1 + Cy2 + Cy3 + Cy4 + Cy5 + Cy6 + Cy7 + Cy8 + Cy9 + Cy10 + Cy11 + Cy12 + Cy13 + Cy14 + Cy15 + Cy16

 Writeeeprom Slowo , 1                                      'zapisz do Eprom pod adres 1.

 Locate 1 , 16                                              '

 Lcd Cy16                                                   '

  Slowo = ""                                                '

                  '

 Cy1 = ""                                                   '

 Cy2 = ""                                                   '

 Cy3 = ""                                                   '

 Cy4 = ""                                                   '

 Cy5 = ""                                                   '

 Cy6 = ""                                                   '

 Cy7 = ""                                                   '

 Cy8 = ""                                                   '

 Cy9 = ""                                                   '

 Cy10 = ""                                                  '

 Cy11 = ""                                                  '

 Cy12 = ""                                                  '

 Cy13 = ""                                                  '

 Cy14 = ""                                                  '

 Cy15 = ""                                                  '

 Cy16 = ""                                                  '

 

 Case 17 : Cy1 = Chr(wyn)                                   '

 Locate 2 , 1                                               'Piszemy w drugiej linii.

 Lcd Cy1                                                    '

 

 Case 18 : Cy2 = Chr(wyn)                                   '

 Locate 2 , 2                                               '

 Lcd Cy2                                                    '

                                                             '

 Case 19 : Cy3 = Chr(wyn)                                   '

 Locate 2 , 3                                               '

 Lcd Cy3                                                    '

 

 Case 20 : Cy4 = Chr(wyn)                                   '

 Locate 2 , 4                                               '

 Lcd Cy4                                                    '

 

 Case 21 : Cy5 = Chr(wyn)                                   '

 Locate 2 , 5                                               '

 Lcd Cy5                                                    '

 

 Case 22 : Cy6 = Chr(wyn)                                   '

 Locate 2 , 6                                               '

 Lcd Cy6                                                    '

 

 Case 23 : Cy7 = Chr(wyn)                                   '

 Locate 2 , 7                                               '

 Lcd Cy7                                                    '

 

 Case 24 : Cy8 = Chr(wyn)

 Locate 2 , 8                                               '

 Lcd Cy8                                                    '

 

 Case 25 : Cy9 = Chr(wyn)                                   '

 Locate 2 , 9                                               '

 Lcd Cy9                                                    '

 

 Case 26 : Cy10 = Chr(wyn)                                  '                                  '

 Locate 2 , 10                                              '

 Lcd Cy10                                                   '

 

 Case 27 : Cy11 = Chr(wyn)                                  '

 Locate 2 , 11                                              '

 Lcd Cy11                                                   '

 

 Case 28 : Cy12 = Chr(wyn)                                  '

 Locate 2 , 12                                              '

 Lcd Cy12                                                   '

 

 Case 29 : Cy13 = Chr(wyn)                                  '

 Locate 2 , 13                                              '

 Lcd Cy13                                                   '

 

 Case 30 : Cy14 = Chr(wyn)                                  '

 Locate 2 , 14                                              '

 Lcd Cy14                                                   '

 

 Case 31 : Cy15 = Chr(wyn)                                  '

 Locate 2 , 15                                              '

 Lcd Cy15                                                   '

 

 Case 32 : Cy16 = Chr(wyn)                                  'Druga linia Lcd zapełniona

 Slowo1 = Cy1 + Cy2 + Cy3 + Cy4 + Cy5 + Cy6 + Cy7 + Cy8 + Cy9 + Cy10 + Cy11 + Cy12 + Cy13 + Cy14 + Cy15 + Cy16

 Writeeeprom Slowo1 , 17                                    '

 Locate 2 , 16                                              '

 Lcd Cy16                                                   '

  Slowo1 = ""                                               '

 Cy1 = ""                                                   '

 Cy2 = ""                                                   '

 Cy3 = ""                                                   '

 Cy4 = ""                                                   '

 Cy5 = ""                                                   '

 Cy6 = ""                                                   '

 Cy7 = ""                                                   '

 Cy8 = ""                                                   '

 Cy9 = ""                                                   '

 Cy10 = ""                                                  '

 Cy11 = ""                                                  '

 Cy12 = ""                                                  '

 Cy13 = ""                                                  '

 Cy14 = ""                                                  '

 Cy15 = ""                                                  '

 Cy16 = ""                                                  '

'-***********

 Case 33 : Cy1 = Chr(wyn)                                   '

 Cls                                                        '

 Locate 1 , 1                                               'Piszemy w pierwszej linii.

 Lcd Cy1                                                    '

 

 Case 34 : Cy2 = Chr(wyn)                                   '

 Locate 1 , 2                                               '

 Lcd Cy2                                                    '

 

 Case 35 : Cy3 = Chr(wyn)                                   '

 Locate 1 , 3                                               '

 Lcd Cy3                                                    '

 

 Case 36 : Cy4 = Chr(wyn)                                   '

 Locate 1 , 4                                               '

 Lcd Cy4                                                    '

 

 Case 37 : Cy5 = Chr(wyn)                                   '

 Locate 1 , 5                                               '

 Lcd Cy5                                                    '

 

 Case 38 : Cy6 = Chr(wyn)                                   '

 Locate 1 , 6                                               '

 Lcd Cy6                                                    '

 

 Case 39 : Cy7 = Chr(wyn)                                   '

 Locate 1 , 7                                               '

 Lcd Cy7                                                    '

 

 Case 40 : Cy8 = Chr(wyn)                                   '

 Locate 1 , 8                                               '

 Lcd Cy8                                                    '

 

 Case 41 : Cy9 = Chr(wyn)                                   '

 Locate 1 , 9                                               '

 Lcd Cy9                                                    '

 

 Case 42 : Cy10 = Chr(wyn)                                  '

 Locate 1 , 10                                              '

 Lcd Cy10                                                   '

 

 Case 43 : Cy11 = Chr(wyn)                                  '

 Locate 1 , 11                                              '

 Lcd Cy11                                                   '

 

 Case 44 : Cy12 = Chr(wyn)                                  '

 Locate 1 , 12                                              '

 Lcd Cy12                                                   '

 

 Case 45 : Cy13 = Chr(wyn)                                  '

 Locate 1 , 13                                              '

 Lcd Cy13                                                   '

 

 Case 46 : Cy14 = Chr(wyn)                                  '

 Locate 1 , 14                                              '

 Lcd Cy14                                                   '

 

 Case 47 : Cy15 = Chr(wyn)                                  '

 Locate 1 , 15                                              '

 Lcd Cy15                                                   '

 

 Case 48 : Cy16 = Chr(wyn)                                  'Pierwsza linia Lcd zapełniona

 Slowo2 = Cy1 + Cy2 + Cy3 + Cy4 + Cy5 + Cy6 + Cy7 + Cy8 + Cy9 + Cy10 + Cy11 + Cy12 + Cy13 + Cy14 + Cy15 + Cy16

 Writeeeprom Slowo2 , 34                                    '

 Locate 1 , 16                                              '

 Lcd Cy16                                                   '

 Slowo2 = ""                                                '

 

 Cy1 = ""                                                   '

 Cy2 = ""                                                   '

 Cy3 = ""                                                   '

 Cy4 = ""                                                   '

 Cy5 = ""                                                   '

 Cy6 = ""                                                   '

 Cy7 = ""                                                   '

 Cy8 = ""                                                   '

 Cy9 = ""                                                   '

 Cy10 = ""                                                  '

 Cy11 = ""                                                  '

 Cy12 = ""                                                  '

 Cy13 = ""                                                  '

 Cy14 = ""                                                  '

 Cy15 = ""                                                  '

 Cy16 = ""                                                  '

 

 Case 49 : Cy1 = Chr(wyn)                                   '

 Locate 2 , 1                                               'Piszemy w drugiej linii.

 Lcd Cy1                                                    '

 

 Case 50 : Cy2 = Chr(wyn)                                   '

 Locate 2 , 2                                               '

 Lcd Cy2                                                    '

 

 Case 51 : Cy3 = Chr(wyn)                                   '

 Locate 2 , 3                                               '

 Lcd Cy3                                                    '

 

 Case 52 : Cy4 = Chr(wyn)                                   '

 Locate 2 , 4                                               '

 Lcd Cy4                                                    '

 

 Case 53 : Cy5 = Chr(wyn)                                   '

 Locate 2 , 5                                               '

 Lcd Cy5                                                    '

 

 Case 54 : Cy6 = Chr(wyn)                                   '

 Locate 2 , 6                                               '

 Lcd Cy6                                                    '

 

 Case 55 : Cy7 = Chr(wyn)                                   '

 Locate 2 , 7                                               '

 Lcd Cy7                                                    '

 

 Case 56 : Cy8 = Chr(wyn)                                   '

 Locate 2 , 8                                               '

 Lcd Cy8                                                    '

 

 Case 57 : Cy9 = Chr(wyn)                                   '

 Locate 2 , 9                                               '

 Lcd Cy9                                                    '

 

 Case 58 : Cy10 = Chr(wyn)                                  '

 Locate 2 , 10                                              '

 Lcd Cy10                                                   '

 

 Case 59 : Cy11 = Chr(wyn)                                  '

 Locate 2 , 11                                              '

 Lcd Cy11                                                   '

 

 Case 60 : Cy12 = Chr(wyn)                                  '

 Locate 2 , 12                                              '

 Lcd Cy12                                                   '

 

 Case 61 : Cy13 = Chr(wyn)                                  '

 Locate 2 , 13                                              '

 Lcd Cy13                                                   '

 Case 62 : Cy14 = Chr(wyn)                                  '

 Locate 2 , 14                                              '

 Lcd Cy14                                                   '

 

 Case 63 : Cy15 = Chr(wyn)                                  '

 Locate 2 , 15                                              '

 Lcd Cy15                                                   '

 

 Case 64 : Cy16 = Chr(wyn)                                  'Druga linia Lcd zapełniona

 Slowo3 = Cy1 + Cy2 + Cy3 + Cy4 + Cy5 + Cy6 + Cy7 + Cy8 + Cy9 + Cy10 + Cy11 + Cy12 + Cy13 + Cy14 + Cy15 + Cy16

 Writeeeprom Slowo3 , 50                                    '

 Locate 2 , 16                                              '

 Lcd Cy16                                                   '

 Slowo3 = ""                                                '

 

 Cy1 = ""                                                   '

 Cy2 = ""                                                   '

 Cy3 = ""                                                   '

 Cy4 = ""                                                   '

 Cy5 = ""                                                   '

 Cy6 = ""                                                   '

 Cy7 = ""                                                   '

 Cy8 = ""                                                   '

 Cy9 = ""                                                   '

 Cy10 = ""                                                  '

 Cy11 = ""                                                  '

 Cy12 = ""                                                  '

 Cy13 = ""                                                  '

 Cy14 = ""                                                  '

 Cy15 = ""                                                  '

 Cy16 = ""                                                  '

'-***********

 Case 65 : Cy1 = Chr(wyn)                                   '

 Cls                                                        '

 Locate 1 , 1                                               'Piszemy w pierwszej linii.

 Lcd Cy1                                                    '

 

 Case 66 : Cy2 = Chr(wyn)                                   '

 Locate 1 , 2                                               '

 Lcd Cy2                                                    '

 

 Case 67 : Cy3 = Chr(wyn)                                   '

 Locate 1 , 3                                               '

 Lcd Cy3                                                    '

 

 Case 68 : Cy4 = Chr(wyn)                                   '

 Locate 1 , 4                                               '

 Lcd Cy4                                                    '

 

 Case 69 : Cy5 = Chr(wyn)                                   '

 Locate 1 , 5                                               '

 Lcd Cy5                                                    '

 

 Case 70 : Cy6 = Chr(wyn)                                   '

 Locate 1 , 6                                               '

 Lcd Cy6                                                    '

 

 Case 71 : Cy7 = Chr(wyn)                                   '

 Locate 1 , 7                                               '

 Lcd Cy7                                                    '

 

 Case 72 : Cy8 = Chr(wyn)                                   'Koniec pierwszej linii Lcd.

 Slowo4 = Cy1 + Cy2 + Cy3 + Cy4 + Cy5 + Cy6 + Cy7 + Cy8     '

 Writeeeprom Slowo4 , 67                                    '

 Locate 1 , 8                                               '

 Lcd Cy8 ;                                                  '

 Slowo4 = ""                                                'Kasuj ośmioliterowe słowo.

 Cy1 = ""                                                   'Kasuj literę.

 Cy2 = ""                                                   '

 Cy3 = ""                                                   '

 Cy4 = ""                                                   '

 Cy5 = ""                                                   '

 Cy6 = ""                                                   '

 Cy7 = ""                                                   '

 Cy8 = ""                                                   '

 Locate 2 , 1                                               '

 Lcd "Koniec tekstu!"                                       '

 Wait 5                                                     '

 Cls                                                        '

 Lcd "  Odczytaj " ;                                        '

  Lowerline                                                 '

  Lcd "zapisany tekst" ;                                    '

 End Select                                                 '

 

    Wyn = 0                                                 '

    Suma = 0                                                '

'------------------------------

  Else                                                      'W przecinym razie, gdy Pinb.1 = 1.

  If Pinb.1 = 0 Then                                        'Przycisk odczytu Eprom.

  Cls                                                       'Czyść.

 

 Readeeprom Slowo , 1                                       'Odczytaj pierwszą szesnastkę tekstu.

 Locate 1 , 1                                               '

 Lcd Slowo                                                  '

 Wait 4                                                     '

 Cls                                                        '

 

 Readeeprom Slowo1 , 17                                     'Odczytaj drugą.

 Locate 1 , 1                                               '

 Lcd Slowo1                                                 '

 Wait 4                                                     '

 Cls                                                        '

 

 Readeeprom Slowo2 , 34                                     'Odczytaj trzecią.

 Locate 1 , 1                                               '

 Lcd Slowo2                                                 '

 Wait 4                                                     '

 Cls                                                        '

 

 Readeeprom Slowo3 , 50                                     'Odczytaj czwartą.

 Locate 1 , 1                                               '

 Lcd Slowo3                                                 '

 Wait 4                                                     '

 Cls                                                        '

 

 Readeeprom Slowo4 , 67                                     'Odczytaj ostatnią ósemkę.

 Locate 1 , 1                                               '

 Lcd Slowo4                                                 '

 Wait 4                                                     '

 Cls                                                        '

 Lcd "Napisz nowy" ;                                        '

 Lowerline                                                  '

 Lcd "tekst (RESET) " ;                                     '

 End If                                                     'Koniec If Pinb.1 = 0.

'----------------------------------

   If Pinb.2 = 0 Then                                       'Przycisk kasowania.

   Slowo = ""                                               '

    Slowo1 = ""                                             '

     Slowo2 = ""                                            '

      Slowo3 = ""                                           '

       Slowo4 = ""                                          '

   Writeeeprom Slowo , 1                                    '

   Writeeeprom Slowo1 , 17                                  '

   Writeeeprom Slowo2 , 34                                  '

   Writeeeprom Slowo3 , 50                                  '

   Writeeeprom Slowo4 , 67                                  '

   Home                                                     '

   Lcd "Skasowano Eprom"                                    '

   End If                                                   'Koniec If Pinb.2 = 0.

'---------------------------------

   End If                                                   'Koniec If Pinb.3 = 0.

   Loop                                                     '

   End                                                      '

 '------------------------------------------------

 'Objaśnienie:

 'Jeśli nastawnikiem kodu BCD zapiszemy tekst 72-literowy,

 'to tekst będzie zawarty w pięciu zmiennych.

 'Zmienne: Slowo, Slowo1, Slowo2, Slowo3 zawierają po 16 znaków, a

 'zmienna Slowo4 zawiera 8 znaków.

 'Po naciśnięciu przycisku Pinb.1 wyświetlą się kolejno wszystkie zapisane znaki.

 'Tekst pozostaje w pamięci nawet po wyłączeniu zasilania.

 'Aby go skasować, należy przycisnąć Pinb.2, przedtem RESET.

 'Pisanie tekstu:

 'Po włączeniu zasilania czekamy do wygaszenia komunikatu.

 'Nastawnikiem kodu BCD nastawiamy cyfrę, np 112, w kodzie Asci jest to p.

 'Aby ją zapisać naciskamy Pinb.3.

 'Gdy wpiszemy 72 znak ukaże się komunikat o końcu tekstu.

 'W tekscie mogą być zawarte wszystkie znaki, np spacja (32), ( (40), % (37), + (43) itd.