dualshock3

Revision:
0:4ac4c7635035
Child:
1:3fbf08dc60b6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ds3_si.h	Thu Sep 07 02:22:00 2017 +0000
@@ -0,0 +1,55 @@
+/*
+        n1  n2          n3  n4  n5  n6
+    d   0   0       d64 -   -   -   -
+    1   □   ↑       >64 L3→ L3↓ R3→ R3↓
+    2   L1  ↓       <64 L3← L3↑ R3← R3↑
+    4   L2  →   
+    8   R1  ←   
+    16  R2  △   
+    32  -   ×   
+    64  -   〇
+*/
+
+#ifndef ds3_si_H
+#define ds3_si_H
+
+#include "mbed.h"
+
+#define PI 3.141592654
+#define square 1
+#define L1 2
+#define L2 4
+#define R1 8
+#define R2 16
+#define up 129
+#define down 130
+#define right 132
+#define left 136
+#define triangle 144
+#define cross 160
+#define circule 192
+#define L 1
+#define R 2
+#define L3x 3
+#define L3y 4
+#define R3x 5
+#define R3y 6
+
+class ds3_si
+{
+    private:
+        Serial serial;
+        Serial pc;
+        char in[8];
+
+    public:
+        ds3_si(PinName tx, PinName rx);
+        ds3_si(PinName tx, PinName rx, int baudrate);
+        void serialin();
+        bool buttonstate(short order);
+        int analogstate(short order);
+        int getinputdata(short order);
+        double getangle(short order);
+        void usb_debug();
+};
+#endif
\ No newline at end of file