USBHID Hello World

Dependencies:   mbed USBDevice

main.cpp

Committer:
samux
Date:
2011-11-11
Revision:
3:8f52e961548d
Parent:
2:d07a799c6926
Child:
5:b1d34990a376

File content as of revision 3:8f52e961548d:

#include "mbed.h"
#include "USBHID.h"

//We declare a USBHID device
USBHID hid;

//This report will contain data to be sent
HID_REPORT send_report;

int main(void) {
    //Fill the report
    for(int i = 0; i < 64; i++)
        send_report.data[i] = i;
    send_report.length = 64;
    
    while (1) {
        //Send the report
        hid.send(&send_report);
        wait(0.1);
    }
}