dimanche 1 novembre 2015

Parallel Port OFF control using vb.net

good day!

I have been coding for a parallel port project which outputs to a group of Light emitting diodes. Here are it's main controls

in order to turn it on, it made a variable that increments according to the checkbox, with 1 being the lowest and 255 the highest..

The first checkbox

 Dim intval2write As Integer
 intval2write = intval2write + 1

The second checkbox

 Dim intval2write As Integer
 intval2write = intval2write + 2

The third checkbox

 Dim intval2write As Integer
 intval2write = intval2write + 4

The last checkbox

 Dim intval2write As Integer
 intval2write = intval2write + 128

Now, my code to turn on the LED's

Try
        Out(&H378, intval2write)
        MessageBox.Show("Successfully Turned On!" & vbNewLine & "Code " & intval2write, "USeP Electrical System", MessageBoxButtons.OK, MessageBoxIcon.Information)
    Catch ex As Exception
        MsgBox(ex.Message, MsgBoxStyle.Critical)
    End Try

Now, my question would be, can I do that with an OFF function? Can you give me good approaches in order to turn off the data lines of the parallel port..

Thanks in advance :D




Aucun commentaire:

Enregistrer un commentaire