Simon Ford / Mbed 2 deprecated keyboard

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "PS2ASCII.h"
00003 
00004 PS2ASCII myKeyboard(p28, p26);
00005 DigitalOut LED(LED1);
00006 
00007 int main() {
00008     while (1) {
00009         unsigned char symbol = myKeyboard.getChar();
00010         if(myKeyboard.E0flag() == true) {          //is the make code one or two bytes long?
00011             printf(" E0 ");
00012         }
00013         printf("%c", symbol);
00014     }
00015 }