
Originally Posted by
Philtkp
I tried changing the variable, PortB to an Integer and Long with no positive results
Well of course it won't work.
PortB is a Visual Basic Byte variable (or whatever you want) which gets stored in a Byte Array and sent over the USB to the PIC as a Byte variable stored in a Byte array, which is then stored in the PIC as a Byte variable.
Code:
Private Sub Check1_Click(index As Integer)
'
' Convert PORTB check box to decimal value before sending it
' to USB bus. Result is store in BufferOut(1)
'
Dim LoopCheck, PORTB As Byte
PORTB = 0
For LoopCheck = 0 to 15 ' 0 To 7
PORTB = PORTB + (Check1(LoopCheck).Value * (2 ^ LoopCheck))
Next
BufferOut(1) = PORTB
WriteSomeData
End Sub
Bookmarks