Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:207850946233
- Child:
- 1:afc3bf972645
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Aug 28 14:37:47 2011 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" +#include "usbhid.h" + +DigitalOut l1(LED1),l2(LED2); + +Serial pc(USBTX, USBRX); // tx, rx +BusIn bus(p21,p22,p23,p24,p25); +usbhid usb; + +int main() +{ + int i=0,j; + + pc.printf("I live! Again ...\r"); + usb.keyboard("rem "); + + while(1){ + wait(.01); + l1=!l1; + j=bus.read(); + if(j){ + //pc.printf("bus: %x i: %d\r",j,i++); + if(j==1) + usb.keyboard(' '); + else if(j==2) + usb.keyboard('i'); + else if(j==4) + usb.keyboard('m'); + else if(j==8) + usb.keyboard('j'); + else if(j==16) + usb.keyboard('l'); + } + } +}