Hi Steve,
If you have the PIC being recognized as an HID device, try this. It's real simple, but will allow you to control an LED from VB6 (should also work with VB5) but I don't have that to test it with.
Create your VB code with EasyHID. Open the project, and drop two command buttons on your form. Add this code for your buttons --
Private Sub Command1_Click()
BufferOut(8) = 0 ' LED on
hidWriteEx VendorID, ProductID, BufferOut(0)
End Sub
Private Sub Command2_Click()
BufferOut(8) = 1 ' LED off
hidWriteEx VendorID, ProductID, BufferOut(0)
End Sub
Modify the PBP code created by EasyHID something like this --
PORTB = 0
TRISB = 0
usbinit ' initialise USB...
ProgramStart:
gosub DoUSBIn
PORTB = USBBuffer[7]
goto ProgramStart
Note this doesn't send data, it's just a sit & spin simple app reading USB input, and placing the value received in USBBuffer(7) on RB.
Bookmarks