3/29/2013

EXAMPLE 03 : 2 Digits 7 Segments LED


EXAMPLE_03.bas

$regfile = "89s8252.dat"
$crystal = 11592000
Dim I As Byte
Dim J As Byte
Dim C As Byte
Dim D As Byte
Dim Number(10) As Byte


Restore Db
  For I = 1 To 10
  Read Number(i)
  Next


Do

For I = 1 To 100
    C = I \ 10
    D = I Mod 10
      For J = 1 To 20

       P2.5 = 1
       P2.6 = 0
       If D = 0 Then D = 10
       P0 = Number(d)
       Waitms 5


       P2.5 = 0
       P2.6 = 1
       If C = 0 Then C = 10
       P0 = Number(c)
       Waitms 5


     Next
Next

Loop


End


Db:                                                           '1234567890
Data &HF9 , &HA4 , &HB0 , &H99 , &H92 , &H83 , &HF8 , &H80 , &H90 , &HC0