home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / VISBASIC / LED / SAMPLE.ZIP / LSAMPLE.FRM next >
Text File  |  1994-11-06  |  6KB  |  197 lines

  1. VERSION 2.00
  2. Begin Form LSAMPLE 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "LED Sample"
  6.    ClientHeight    =   465
  7.    ClientLeft      =   1605
  8.    ClientTop       =   1740
  9.    ClientWidth     =   3825
  10.    Height          =   870
  11.    Left            =   1545
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   465
  16.    ScaleWidth      =   3825
  17.    Top             =   1395
  18.    Width           =   3945
  19.    Begin Timer Timer1 
  20.       Interval        =   55
  21.       Left            =   240
  22.       Top             =   240
  23.    End
  24.    Begin MabryLED LED1 
  25.       BackColor       =   &H00C0C0C0&
  26.       BevelInner      =   3  'Lowered
  27.       BevelInnerShape =   1  'Ellipse
  28.       BevelOuter      =   1  'Raised
  29.       BevelOuterShape =   0  'Rectangle
  30.       BevelWidth      =   1
  31.       Border          =   1  'Single Width
  32.       BorderWidth     =   4
  33.       DisabledColor   =   &H00C0C0C0&
  34.       Height          =   465
  35.       Index           =   7
  36.       Left            =   3360
  37.       OffColor        =   &H00808080&
  38.       OnColor         =   &H000000FF&
  39.       Top             =   0
  40.       Value           =   -1  'True
  41.       Width           =   465
  42.    End
  43.    Begin MabryLED LED1 
  44.       BackColor       =   &H00C0C0C0&
  45.       BevelInner      =   3  'Lowered
  46.       BevelInnerShape =   1  'Ellipse
  47.       BevelOuter      =   1  'Raised
  48.       BevelOuterShape =   0  'Rectangle
  49.       BevelWidth      =   1
  50.       Border          =   1  'Single Width
  51.       BorderWidth     =   4
  52.       DisabledColor   =   &H00C0C0C0&
  53.       Height          =   465
  54.       Index           =   6
  55.       Left            =   480
  56.       OffColor        =   &H00808080&
  57.       OnColor         =   &H000000FF&
  58.       Top             =   0
  59.       Value           =   -1  'True
  60.       Width           =   465
  61.    End
  62.    Begin MabryLED LED1 
  63.       BackColor       =   &H00C0C0C0&
  64.       BevelInner      =   3  'Lowered
  65.       BevelInnerShape =   1  'Ellipse
  66.       BevelOuter      =   1  'Raised
  67.       BevelOuterShape =   0  'Rectangle
  68.       BevelWidth      =   1
  69.       Border          =   1  'Single Width
  70.       BorderWidth     =   4
  71.       DisabledColor   =   &H00C0C0C0&
  72.       Height          =   465
  73.       Index           =   5
  74.       Left            =   960
  75.       OffColor        =   &H00808080&
  76.       OnColor         =   &H000000FF&
  77.       Top             =   0
  78.       Value           =   -1  'True
  79.       Width           =   465
  80.    End
  81.    Begin MabryLED LED1 
  82.       BackColor       =   &H00C0C0C0&
  83.       BevelInner      =   3  'Lowered
  84.       BevelInnerShape =   1  'Ellipse
  85.       BevelOuter      =   1  'Raised
  86.       BevelOuterShape =   0  'Rectangle
  87.       BevelWidth      =   1
  88.       Border          =   1  'Single Width
  89.       BorderWidth     =   4
  90.       DisabledColor   =   &H00C0C0C0&
  91.       Height          =   465
  92.       Index           =   4
  93.       Left            =   1440
  94.       OffColor        =   &H00808080&
  95.       OnColor         =   &H000000FF&
  96.       Top             =   0
  97.       Value           =   -1  'True
  98.       Width           =   465
  99.    End
  100.    Begin MabryLED LED1 
  101.       BackColor       =   &H00C0C0C0&
  102.       BevelInner      =   3  'Lowered
  103.       BevelInnerShape =   1  'Ellipse
  104.       BevelOuter      =   1  'Raised
  105.       BevelOuterShape =   0  'Rectangle
  106.       BevelWidth      =   1
  107.       Border          =   1  'Single Width
  108.       BorderWidth     =   4
  109.       DisabledColor   =   &H00C0C0C0&
  110.       Height          =   465
  111.       Index           =   3
  112.       Left            =   1920
  113.       OffColor        =   &H00808080&
  114.       OnColor         =   &H000000FF&
  115.       Top             =   0
  116.       Value           =   -1  'True
  117.       Width           =   465
  118.    End
  119.    Begin MabryLED LED1 
  120.       BackColor       =   &H00C0C0C0&
  121.       BevelInner      =   3  'Lowered
  122.       BevelInnerShape =   1  'Ellipse
  123.       BevelOuter      =   1  'Raised
  124.       BevelOuterShape =   0  'Rectangle
  125.       BevelWidth      =   1
  126.       Border          =   1  'Single Width
  127.       BorderWidth     =   4
  128.       DisabledColor   =   &H00C0C0C0&
  129.       Height          =   465
  130.       Index           =   2
  131.       Left            =   2400
  132.       OffColor        =   &H00808080&
  133.       OnColor         =   &H000000FF&
  134.       Top             =   0
  135.       Value           =   -1  'True
  136.       Width           =   465
  137.    End
  138.    Begin MabryLED LED1 
  139.       BackColor       =   &H00C0C0C0&
  140.       BevelInner      =   3  'Lowered
  141.       BevelInnerShape =   1  'Ellipse
  142.       BevelOuter      =   1  'Raised
  143.       BevelOuterShape =   0  'Rectangle
  144.       BevelWidth      =   1
  145.       Border          =   1  'Single Width
  146.       BorderWidth     =   4
  147.       DisabledColor   =   &H00C0C0C0&
  148.       Height          =   465
  149.       Index           =   1
  150.       Left            =   2880
  151.       OffColor        =   &H00808080&
  152.       OnColor         =   &H000000FF&
  153.       Top             =   0
  154.       Value           =   -1  'True
  155.       Width           =   465
  156.    End
  157.    Begin MabryLED LED1 
  158.       BackColor       =   &H00C0C0C0&
  159.       BevelInner      =   3  'Lowered
  160.       BevelInnerShape =   1  'Ellipse
  161.       BevelOuter      =   1  'Raised
  162.       BevelOuterShape =   0  'Rectangle
  163.       BevelWidth      =   1
  164.       Border          =   1  'Single Width
  165.       BorderWidth     =   4
  166.       DisabledColor   =   &H00C0C0C0&
  167.       Height          =   465
  168.       Index           =   0
  169.       Left            =   0
  170.       OffColor        =   &H00808080&
  171.       OnColor         =   &H000000FF&
  172.       Top             =   0
  173.       Value           =   -1  'True
  174.       Width           =   465
  175.    End
  176. End
  177. Option Explicit
  178.  
  179. Sub Form_Unload (Cancel As Integer)
  180.     End
  181. End Sub
  182.  
  183. Sub Timer1_Timer ()
  184.     Dim I As Integer
  185.     Dim J As Integer
  186.     Dim N As Integer
  187.  
  188.     ' Randomly blink from 1 to 3 of the LEDs
  189.     N = Int(Rnd * 3) + 1
  190.  
  191.     For J = 1 To N
  192.         I = Int(Rnd * 8)
  193.         LED1(I).Value = Not LED1(I).Value
  194.     Next J
  195. End Sub
  196.  
  197.