PS3のサンプル 受信したdualshock3の状態を確認

Dependencies:   PS3

Files at this revision

API Documentation at this revision

Comitter:
number_key
Date:
Tue Sep 25 07:31:13 2018 +0000
Parent:
1:67eb13b42312
Commit message:
ring buffer

Changed in this revision

PS3.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
diff -r 67eb13b42312 -r 90609e82800f PS3.lib
--- a/PS3.lib	Fri Aug 31 02:26:28 2018 +0000
+++ b/PS3.lib	Tue Sep 25 07:31:13 2018 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/NHK-Robocon2016_Nagaoka_B_Team/code/PS3/#7bd8296e6908
+https://os.mbed.com/teams/NHK-Robocon2016_Nagaoka_B_Team/code/PS3/#78827486d24f
diff -r 67eb13b42312 -r 90609e82800f main.cpp
--- a/main.cpp	Fri Aug 31 02:26:28 2018 +0000
+++ b/main.cpp	Tue Sep 25 07:31:13 2018 +0000
@@ -1,12 +1,12 @@
 #include "mbed.h"
 #include "PS3.h"
-
-PS3 ps3(PC_12, PD_2);;
+ 
+PS3 ps3(PB_6, PB_7);;
 Serial pc(USBTX, USBRX, 230400);
-
+ 
 int main()
 {
-    pc.printf("start\rn");
+    pc.printf("start\r\n");
     while(true) {
         while(!ps3.status) printf("disconnected\r\n");
         for(int i = 0; i < 4; i++) {
@@ -15,9 +15,10 @@
         for(int i = 0; i < 2; i++) {
             pc.printf("%d ", ps3.getTrigger(i));
         }
-        for(int i = 0; i < 15; i++) {
+        for(int i = 0; i < 12; i++) {
             pc.printf("%d ", ps3.getButton(i));
         }
         pc.printf("\r\n");
     }
-}
\ No newline at end of file
+}
+    
\ No newline at end of file