A test program for PS2 library.

Dependencies:   mbed

Revision:
0:aabf6427c82e
Child:
1:e5eac8a97060
--- /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);
+    }
+}