testing library PS2

Dependencies:   PS_PAD mbed

Files at this revision

API Documentation at this revision

Comitter:
rizqicahyo
Date:
Mon Jan 25 17:45:06 2016 +0000
Commit message:
testing PS2 library

Changed in this revision

PS_PAD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 898184096d90 PS_PAD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PS_PAD.lib	Mon Jan 25 17:45:06 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/okini3939/code/PS_PAD/#840370e1dcce
diff -r 000000000000 -r 898184096d90 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 25 17:45:06 2016 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+#include "PS_PAD.h"
+
+PS_PAD ps2(PB_15,PB_14,PB_13, PC_4);
+
+Serial pc(USBTX,USBRX);
+
+int main()
+{
+    pc.baud(115200);
+    ps2.init();
+    
+    while(1)
+    {   
+        ps2.poll();     
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_L2));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_R2));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_L1));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_R1));
+        
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_TRIANGLE));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_CIRCLE));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_X));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_SQUARE));
+        
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_SELECT));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_L3));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_R3));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_START));
+        
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_TOP));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_RIGHT));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_BOTTOM));
+        pc.printf("%i ",ps2.read(PS_PAD :: PAD_LEFT));
+        
+        pc.printf("%i ",ps2.read(PS_PAD :: ANALOG_LX));
+        pc.printf("%i ",ps2.read(PS_PAD :: ANALOG_LY));
+        pc.printf("%i ",ps2.read(PS_PAD :: ANALOG_RX));
+        pc.printf("%i \n",ps2.read(PS_PAD :: ANALOG_RY));    
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 898184096d90 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jan 25 17:45:06 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96
\ No newline at end of file