USBHID Hello World

Dependencies:   mbed USBDevice

Committer:
samux
Date:
Thu Nov 03 12:30:56 2011 +0000
Revision:
2:d07a799c6926
Parent:
1:0216a6726c1c
Child:
3:8f52e961548d

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samux 0:30b74cf0e645 1 #include "mbed.h"
samux 0:30b74cf0e645 2 #include "USBHID.h"
samux 0:30b74cf0e645 3
samux 2:d07a799c6926 4 //We declare a USBHID device
samux 2:d07a799c6926 5 USBHID hid;
samux 1:0216a6726c1c 6
samux 2:d07a799c6926 7 //This report will contain data to be sent
samux 1:0216a6726c1c 8 HID_REPORT send_report;
samux 1:0216a6726c1c 9
samux 0:30b74cf0e645 10 int main(void) {
samux 2:d07a799c6926 11 //Fill the report
samux 2:d07a799c6926 12 for(int i = 0; i < 64; i++)
samux 2:d07a799c6926 13 send_report.data[i] = i;
samux 2:d07a799c6926 14 send_report.length = 64;
samux 2:d07a799c6926 15
samux 0:30b74cf0e645 16 while (1) {
samux 2:d07a799c6926 17 //Send the report
samux 2:d07a799c6926 18 hid.send(&send_report);
samux 1:0216a6726c1c 19 wait(0.01);
samux 0:30b74cf0e645 20 }
samux 0:30b74cf0e645 21 }