Based on USBKeyboardMouse example. I added USB String Descriptor so mbed reports itself to host not only with VID & PID but also with name of manufacturer, product name, serial number, configuration number and interface name. These can be changed to matching Yours in USBhid.cpp file on lines 88 - 122.
main.cpp
- Committer:
- llumpu
- Date:
- 2011-09-08
- Revision:
- 0:f97b1f255167
File content as of revision 0:f97b1f255167:
#include "mbed.h" #include "USBMouse.h" #include "USBKeyboard.h" DigitalOut led(LED1); USBMouse mouse; USBKeyboard keyboard; int main() { while(1) { mouse.move(18, 10); //moves the mouse down and to the left keyboard.sendKeys("mbed"); //sends the word "foo" through the keyboard led = !led; //cycles the LED on/off wait(2); //waits 2 seconds, then repeats } }