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.
main.cpp
- Committer:
- norberts
- Date:
- 2011-11-19
- Revision:
- 2:1a24252c8cb1
- Parent:
- 1:afc3bf972645
- Child:
- 3:13401b125368
File content as of revision 2:1a24252c8cb1:
#include "mbed.h" #include "usbhid.h" DigitalOut l1(LED1),l2(LED2); Serial pc(USBTX, USBRX); // tx, rx BusIn bus(p21,p23,p24,p25,p26); usbhid usb; char k[]={' ','w','s','a','d'}; //fudlr int main() { int i,b,lb=0,s; pc.printf("I live! Again ...\r"); while (1) { wait(.01); l1=!l1; b=bus.read(); if (b!=lb) { l2=1; if (b) { for (i=0; i<5; i++) { s=(b&(1<<i))!=0; if (s) usb.keyboard2(k[i]); } } else usb.keyboard2(0); lb=b; } else l2=0; } }