sample of getting console key

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 Serial  pc( USBTX, USBRX );
00004 BusOut  leds( LED4, LED3, LED2, LED1 );
00005 
00006 int main()
00007 {
00008     while (1) {
00009         if ( pc.readable() ) {
00010             leds    = pc.getc() - '0';
00011         }
00012     }
00013 }