Do you receive the Programmer's Heaven newsletter? If not, why not subscribe?
*/
*/

View vb\arrayexample\arrayexample.frm

Printer Port Interfacing 1 V1.0

Submitted By: myscripting
Rating: starstarstarstar (Rate It)


VERSION 5.00
Begin VB.Form Form1
   Caption         =   "Array example"
   ClientHeight    =   2115
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2115
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command2
      Caption         =   "Loop Down through leds"
      Height          =   495
      Left            =   840
      TabIndex        =   1
      Top             =   1320
      Width           =   2895
   End
   Begin VB.CommandButton Command1
      Caption         =   "Loop up through leds"
      Height          =   495
      Left            =   840
      TabIndex        =   0
      Top             =   360
      Width           =   2895
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Base 1

Dim MyArray(10) As Single
Dim counter As Integer




Private Sub Command1_Click()
MyArray(1) = 0
MyArray(2) = 1
MyArray(3) = 2
MyArray(4) = 4
MyArray(5) = 8
MyArray(6) = 16
MyArray(7) = 32
MyArray(8) = 64
MyArray(9) = 128
MyArray(10) = 255
Port1 = 888
For counter = 1 To 10
    Out Port1, MyArray(counter)
    Sleep (250)
Next
End Sub

Private Sub Command2_Click()
MyArray(1) = 0
MyArray(2) = 1
MyArray(3) = 2
MyArray(4) = 4
MyArray(5) = 8
MyArray(6) = 16
MyArray(7) = 32
MyArray(8) = 64
MyArray(9) = 128
MyArray(10) = 255
Port1 = 888
For counter = 10 To 1 Step -1
    Out Port1, MyArray(counter)
    Sleep (250)
Next
End Sub

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings