Results 1 to 6 of 6

Thread: 4 button switchboard

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    3

    4 button switchboard

    Hello

    I need some help in modifying my Visual Basic 5 code
    I have a USBmicro interface board connected to the PC I have 4 switchs on 4 seperate ports
    so when I press the read0 command button and hold down one of 4 momentary switchs the backcolor changes from &HFF to &H80

    The following is the current sequence

    1. Run program in windows
    2. Push switch in on the u401 and hold, Click read0 command button in the form1 code.
    3. backcolor changes from &HFF to &H80
    4. release switch click read0 command button
    backcolor goes back to &HFF

    The sequence I would like is

    1. Run program in windows
    2. push switch in momentary
    3. color changes from &HFF to &H80
    4. release switch backcolor goes back to &HFF

    The following code lies in my form1 (demotest.frm) which also has the following module files so as to acces the U401.

    osinterface.bas
    hidinterface.bas
    miscfunc.bas
    USBmAPI.bas

    The code that needs to be modifided is as follows


    Private Sub Read0_Click()

    USBm_ReadA 0, State0

    Write0Value.Text = TwoHexCharacters$(State0)

    If State0 And &H1 Then D0.BackColor = &HFF Else D0.BackColor = &H80
    If State0 And &H2 Then D1.BackColor = &HFF Else D1.BackColor = &H80
    If State0 And &H4 Then D2.BackColor = &HFF Else D2.BackColor = &H80
    If State0 And &H8 Then D3.BackColor = &HFF Else D3.BackColor = &H80

    If you require more technial help please go to http://www.usbmicro.com


    Thank you hope to hear from someone soon.
    Last edited by Sally6; Apr 26th, 2005 at 02:48 AM. Reason: url not working

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width