User manual
576
mikoBasic PRO for PIC32
MikroElektronika
Library Example
This example establishes connection with the HID terminal that is active on the PC. Upon connection establishment,
the HID Device Name will appear in the respective window. After that software will wait for data and it will return
received data back. Examples uses USBdsc.mbas descriptor le, which is in the same folder, and can be created by
the HID Terminal.
Copy Code To Clipboard
program HID_Write_Polling
dim cnt,kk as char
dim readbuff as char[64]
dim writebuff as char[64]
main:
CHECON = 0x32
AD1PCFG = 0xFFFF
HID_Enable(@readbuff,@writebuff)
while TRUE
USB_Polling_Proc() ‘ Call this routine periodically
kk = HID_Read()
if (kk <> 0) then
for cnt=0 to 63
writebuff[cnt]=readbuff[cnt]
next cnt
HID_Write(@writebuff,64)
end if
wend
end.
HW Connection
USB connection scheme