Dim Value(6) As Byte

Public Sub Form_Load()

' Initialize the display

For i% = 0 To 6

    Slider(6 - i%).Value = 255 / (i% + 1)

    Call Slider_Change(i%)

    Next i%

End Sub

Private Sub Slider_Change(index As Integer)

If index <> 6 Then

    Value(index) = Slider(index).Value * (Slider(6).Value / 255)

    Light(index).FillColor = RGB(Value(index), Value(index), 0)

    Else ' Master slider operated

    For i% = 0 To 5: Call Slider_Change(i%): Next i%

    End If

' Mimic all changes to the real hardware

Call WriteUSBdevice(AddressFor(Value(0)), 6)

End Sub