'Šteje od 0000 do 9999 s polno hitrostjo

$regfile = "m8515.dat"
Config Portd = Output
Config Portb = Output


Dim Z1 As Byte , Z2 As Byte , Z3 As Byte , Z4 As Byte

Do
  For Z1 = 0 To 9
    For Z2 = 0 To 9
      For Z3 = 0 To 9
        For Z4 = 0 To 9
          Gosub Prikaz
        Next
      Next
    Next
  Next
Loop

Prikaz:
   Portb = Lookup(z4 , Tabela_0f)
   Portd.3 = 0                                              ' 1. prikazovalnik
   Waitms 3
   Portd.3 = 1
   Portb = Lookup(z3 , Tabela_0f)
   Portd.7 = 0                                                 ' 2. prikazovalnik
   Waitms 3
   Portd.7 = 1
   Portb = Lookup(z2 , Tabela_0f)
   Portd.5 = 0                                                 ' 3. prikazovalnik
   Waitms 3
   Portd.5 = 1
   Portb = Lookup(z1 , Tabela_0f)
   Portd.4 = 0                                                 ' 4. prikazovalnik
   Waitms 3
   Portd.4 = 1
Return

' Tabela s številkami 0-9, A-F, nova testna plošča
Tabela_0f:
   Data &B01000001 , &B11011101 , &B01100100 , &B01001100
   Data &B11011000 , &B01001010 , &B01000010 , &B01011101
   Data &B01000000 , &B01001000 , &B01010000 , &B11000010
   Data &B01100011 , &B11000100 , &B01100010 , &B01110010