I exactly copy and paste the code in help file of mikrobasic but HEX file not generate . please find the code and error message blow:
Code: Select all
program HID_Read_Write_Interrupt
dim cnt as char
dim readbuff as byte[64] absolute 0x500 ' Buffers should be in USB RAM, please consult datasheet
dim writebuff as byte[64] absolute 0x540
sub procedure Interrupt()
USB_Interrupt_Proc() ' USB servicing is done inside the interrupt
end sub
main:
ADCON1 = ADCON1 or 0x0F ' Configure all ports with analog function as digital
CMCON = CMCON or 7 ' Disable comparators
HID_Enable(@readbuff,@writebuff) ' Enable HID communication
while TRUE
while(HID_Read() = 0)
wend
for cnt=0 to 63
writebuff[cnt] = readbuff[cnt]
next cnt
while(HID_Write(@writebuff,64) = 0)
wend
wend
end.