USBHID Hello World

Dependencies:   mbed USBDevice

main.cpp

Committer:
samux
Date:
2011-11-03
Revision:
2:d07a799c6926
Parent:
1:0216a6726c1c
Child:
3:8f52e961548d

File content as of revision 2:d07a799c6926:

#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.01);
    }
}