hassanzia
Junior Member level 3
- Joined
- Nov 24, 2011
- Messages
- 30
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,506
Hi all,
I'm trying to emulate a mouse by using a P18F4550 and an ADNS optical sensor. According to my best understanding (I may be wrong here) the host receives movement data of the mouse via the following code, which is taken directly from the HID Demo provided by Microchip :
I have been able to successfully simulate the movement of a mouse using the above code. However, now I'm uncertain as to how to send the information regarding the buttons of the mouse (ie whether one button is pressed or not) by modifying the above code. Any help with my problem or with the general structure of the HID class would be appreciated.
I'm trying to emulate a mouse by using a P18F4550 and an ADNS optical sensor. According to my best understanding (I may be wrong here) the host receives movement data of the mouse via the following code, which is taken directly from the HID Demo provided by Microchip :
Code:
// the parameter hid_report_in holds the data to be sent and 0x03 is the size of this data (in bytes).
// I am unable to figure what the first parameter is for.
lastTransmission = HIDTxPacket(HID_EP, (BYTE*)hid_report_in, 0x03);
I have been able to successfully simulate the movement of a mouse using the above code. However, now I'm uncertain as to how to send the information regarding the buttons of the mouse (ie whether one button is pressed or not) by modifying the above code. Any help with my problem or with the general structure of the HID class would be appreciated.