A optical beam breaker detector that appears to aPC as a USB keyboard, typing characters when the beam is broken

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Thu May 12 16:46:53 2011 +0000
Parent:
0:9d0f47bc66da
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu May 12 16:44:09 2011 +0000
+++ b/main.cpp	Thu May 12 16:46:53 2011 +0000
@@ -2,24 +2,16 @@
 #include "USBKeyboard.h"
 
 DigitalOut trigger(LED1);
-
 DigitalIn event(p22);
-
 USBKeyboard k;
 
 int main() {
-
     while (1) {
-
         trigger = event;
-
         if (event) {
-  
             k.putc('|');
             trigger = event;
-
             wait(1);
-  
             while (!event) {
                 trigger = event;
             }