Hello Simon and fellow USB device creators,
Simon first of all thanks for all of your hard work and getting your stuff on here for us all to benefit. Simon, I am working on a project whereby I want to have five inputs control five outputs using the PIC18F4550. So if there is a 1 on RA0, I want the output at RB0 to be a 1. I am familiar with C and I think I have my code correct here: I just inserted my piece of code in place of everything you had in the 'process input & output' section like so:
// Process input and output
// If we are not in the configured state just return
if((USBDeviceState < CONFIGURED_STATE)||(USBSuspendControl==1)) return;
// We support the following commands:
// 0x80 Toggle the LED
// 0x81 Read the push-switch status
// 0x82 Read the LED status
//Check if data was received from the host.
if (RA0 == 1)
RB0 = 1;
// Re-arm the OUT endpoint for the next packet
USBOutHandle = HIDRxPacket(HID_EP,(BYTE*)&ReceivedDataBuffer,64);
And so I just have a switch at RA0 and when I push it I want RB0 to go "high". Well I am not getting a high on RB0 with just the USB device plugged in, and by the way, the device is recognized by my computer. My question is, do I need to run a program like your WFF HID demo application in order to get a 1 on RB0 when a push RA0 swtich? Or could I just plug it in and push the button to get my output, assuming the code is correct?
Thanks in advance for your time. And thanks to anyone else who may assist me with this.