bayabi
Newbie level 6

Hey there I want to control my PIC from PC and send feedback from PIC. I can easily control my PIC, however; the pic to PC part does not work. I have defined a function named USB_DATA on C18 on pic side :
and on my PC side I try to read my send_data[1] via :
Where do I do wrong? I guess I am sending the data right way. But due to the misusage of MPUSBRead function I cant read it on visual side.
Thanks for your helps
Best regards..
Code:
void USB_Data(void)
{
send_data[1] = 1;
if(!mUSBGenTxIsBusy() )
{
USBGenWrite(send_data[1],2);
}
}
Code:
unsigned char Data = 0;
data_in[1] = Data;
while(1)
{
if(Data == 1)
{
cout << "Data_here";
}
if(MPUSBRead(inPipe , data_in, 2, &ActualLength, 1000));
}
Where do I do wrong? I guess I am sending the data right way. But due to the misusage of MPUSBRead function I cant read it on visual side.
Thanks for your helps
Best regards..