Shinichiro Nakamura
/
PS2_TestProgram
A test program for PS2 library.
Diff: main.cpp
- Revision:
- 0:aabf6427c82e
- Child:
- 1:e5eac8a97060
diff -r 000000000000 -r aabf6427c82e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Aug 29 11:09:48 2010 +0000 @@ -0,0 +1,29 @@ +/** + * Test program. + * + * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) + * http://shinta.main.jp/ + */ + +#include "mbed.h" +#include "PS2.h" + +PS2 ps2kb(p17, p18); + +int main() { + while (1) { + /* + * Keyboard. + */ + if (ps2kb.exists()) { + uint8_t buf[32]; + int n = ps2kb.getData(buf, sizeof(buf)); + printf("KB:"); + for (int i = 0; i < n; i++) { + printf("%02X ", buf[i]); + } + printf("\n"); + } + wait_ms(100); + } +}