PlayStation Controller library
Dependents: PSController_Sample coba_stick_PS2 basehybrid_PSPAD Base_Hybrid_V3 ... more
PlayStation Controller
SONY プレイステーション2用コントローラーを mbed に接続して使えるライブラリです。
SPI 機能を使います。
サードパーティ製や、VSTONE製のコントローラー(VS-C1、VS-C3)も使用できます。
ピンアサイン
PS PAD
========================= | 9 8 7 | 6 5 4 | 3 2 1 | -----------------------
PS PAD | VS-C3 | Signal | mbed |
1 | 3 | DAT | MISO |
2 | 4 | CMD | MOSI |
3 | +5-7V | ||
4 | 10 | GND | GND |
5 | 9 | +3V | +3.3V |
6 | 5 | SEL | CS |
7 | 6 | CLK | SCK |
8 | |||
9 | ACK |
Diff: PS_PAD.h
- Revision:
- 1:840370e1dcce
- Parent:
- 0:6eeefcf5a37a
--- a/PS_PAD.h Wed Dec 11 04:42:44 2013 +0000 +++ b/PS_PAD.h Thu Dec 12 09:04:45 2013 +0000 @@ -24,6 +24,7 @@ PAD_L1, PAD_R2, PAD_L2, + BUTTONS, ANALOG_RX, ANALOG_RY, ANALOG_LX, @@ -41,8 +42,9 @@ private: SPI _spi; DigitalOut _cs; - char _pad[6]; + uint8_t _pad[6]; int _vib1, _vib2; + bool _connected; int send (const char *cmd, int len, char *dat); };