Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: PS3_sample Nucleo_NHK_2018_syudo_wheel kourobo kourobo5 ... more
Diff: PS3.h
- Revision:
- 2:f41f9d145429
- Parent:
- 1:7bd8296e6908
- Child:
- 3:78827486d24f
diff -r 7bd8296e6908 -r f41f9d145429 PS3.h
--- a/PS3.h Fri Aug 31 02:25:35 2018 +0000
+++ b/PS3.h Tue Sep 11 08:26:51 2018 +0000
@@ -4,7 +4,7 @@
#include "mbed.h"
#include <vector>
-#define PS3_TIMEOUT_COUNT 100
+#define PS3_TIMEOUT_COUNT 200
#define PS3_BUFFER_SIZE 22
#define PS3_HEADER0 'R'
#define PS3_HEADER1 'B'
@@ -20,17 +20,17 @@
#define DOWN 1
#define LEFT 2
#define RIGHT 3
-#define TRIANGLE 4
-#define CROSS 5
-#define SQUARE 6
-#define CIRCLE 7
-#define L1 8
-#define R1 9
+#define TRIANGLE 6
+#define CROSS 7
+#define SQUARE 8
+#define CIRCLE 9
+#define L1 4
+#define R1 5
#define L3 10
#define R3 11
-#define PS 12
-#define SELECT 13
-#define START 14
+// #define PS 12
+// #define SELECT 13
+// #define START 14
class PS3 : public RawSerial
{
@@ -52,7 +52,7 @@
std::vector<unsigned char> buf;
int timeout;
- bool button[15];
+ bool button[12];
uint8_t stick[4];
uint8_t trigger[2];
};