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:
- 1:7bd8296e6908
- Parent:
- 0:fc5f65cdaaa8
- Child:
- 2:f41f9d145429
--- a/PS3.h Thu Aug 30 06:04:11 2018 +0000
+++ b/PS3.h Fri Aug 31 02:25:35 2018 +0000
@@ -4,10 +4,12 @@
#include "mbed.h"
#include <vector>
+#define PS3_TIMEOUT_COUNT 100
#define PS3_BUFFER_SIZE 22
#define PS3_HEADER0 'R'
#define PS3_HEADER1 'B'
#define PS3_HEADER2 'N'
+
#define LEFT_X 0
#define LEFT_Y 1
#define RIGHT_X 2
@@ -38,15 +40,17 @@
bool getButton(int n);
uint8_t getStick(int n);
uint8_t getTrigger(int n);
- std::vector<unsigned char> buf;
// Thread thread;
-
+ bool status;
+
private :
void receiveByte();
void assemble();
void assembleLoop();
Ticker assembleTicker;
+ std::vector<unsigned char> buf;
+ int timeout;
bool button[15];
uint8_t stick[4];