1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RaspberryPi 3B+ (Ubuntu Mate 16.04LTS) をPS4 DualShockコントローラで動かす

Posted at

目的

RaspberryPi 3B+ (Ubuntu Mate 16.04LTS) をPS4 DualShockコントローラで動かした際の備忘録です

準備

Raspberry Pi 3 Model B+
PS4 DualShockコントローラ

下記コマンドでSony DualShock4 ドライバをインストール

$ sudo pip install ds4drv

テスト

PS4コントローラの「PSボタン」「SHAREボタン」を同時押してコントローラとRaspberryPiをペアリングする。

$ sudo ds4drv

サンプルコードは下記サイトのものを利用させて頂きます。

PS4のコントローラの値をLinuxで表示

$ g++ -o testps4drv testps4drv.cpp 
$ ./testps4drv 
0 : コントローラからの入力がないと0
1 : コントローラからの入力があると1

備考

互換品のDualShock 4 コントローラで上記の通りペアリングを行った記事が見付かりませんでした。
電子工作用途であっても正規品DualShock 4を利用した方が良いかもしれません。(BT通信フォーマットの差分が影響している?)

参考

A Sony DualShock 4 userspace driver for Linux
PS4のコントローラの値をLinuxで表示
ホイール欲しい ハンドル欲しい
eleccelerator DualShock 4

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?