Quote Originally Posted by Philtkp View Post
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
PortB is a byte value. A byte runs 0-255...
2 ^ 15 = 32,768 which is greater than 255!