Library&Source / PS3_to_Arduino

Dependents:   throw_1

Files at this revision

API Documentation at this revision

Comitter:
masaaki_nr
Date:
Fri Nov 08 10:11:32 2019 +0000
Parent:
2:422d5d7602cc
Commit message:
add to disconect

Changed in this revision

Arduino_PRO.txt Show annotated file Show diff for this revision Revisions of this file
PS3_Controller.cpp Show annotated file Show diff for this revision Revisions of this file
PS3_Controller.h Show annotated file Show diff for this revision Revisions of this file
--- a/Arduino_PRO.txt	Sat Apr 06 06:37:13 2019 +0000
+++ b/Arduino_PRO.txt	Fri Nov 08 10:11:32 2019 +0000
@@ -81,6 +81,10 @@
         if (PS3.getButtonClick(SELECT))   bitSet(botton_val, 13);
         if (PS3.getButtonClick(START))    bitSet(botton_val, 14);
         break;
+
+       case 3:
+        PS3.disconnect();
+        break;
       }
       /***********************************************/
       str[0] = botton_val & 0x00ff;
--- a/PS3_Controller.cpp	Sat Apr 06 06:37:13 2019 +0000
+++ b/PS3_Controller.cpp	Fri Nov 08 10:11:32 2019 +0000
@@ -44,4 +44,8 @@
 bool PS3_controller::conect(void)
 {
     return controller_check;
+}
+
+void PS3_controller::disconect(void){
+    _uno.putc(3);
 }
\ No newline at end of file
--- a/PS3_Controller.h	Sat Apr 06 06:37:13 2019 +0000
+++ b/PS3_Controller.h	Fri Nov 08 10:11:32 2019 +0000
@@ -39,6 +39,7 @@
     int button(int);
     int analog(int);
     bool conect(void);
+    void disconect(void);
 
 private:
     Serial _uno;