i was messaging from mobile.
<code>
#include "USBdsc.c"
unsigned char readbuff[64] absolute 0x500; // Buffers should be in USB RAM, please consult datasheet
unsigned char writebuff[64] absolute 0x540;
int num;
char cnt;
char kk;
void interrupt(){
USB_Interrupt_Proc(); // USB servicing is done inside the interrupt
}
void main(void){
ADCON1 |= 0x0F; // Configure all ports with analog function as digital
CMCON |= 7; // Disable comparators
TRISD=0x00;
HID_Enable(&readbuff,&writebuff); // Enable HID communication
while(1){
while(!HID_Read());
//asciitonum(readbuff[0],num);
//str2dec(readbuff[0],num);
//num=0x0[&readbuff[0]];
num=readbuff[0];
// num=48-num
PORTD=num;
for(cnt=0;cnt<64;cnt++)
writebuff[cnt]=readbuff[cnt];
while(!HID_Write(&writebuff,64));
}
}
</code>
this is the code
and the image is attached. check that