{"id":6898,"date":"2015-03-03T22:52:38","date_gmt":"2015-03-03T13:52:38","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=6898"},"modified":"2015-03-03T22:54:53","modified_gmt":"2015-03-03T13:54:53","slug":"raspberry-pi-%e3%81%a7%e6%88%a6%e8%bb%8a%e3%82%92%e4%bd%9c%e3%82%8b%ef%bc%88bluetoothps3-dualshock3%e7%b7%a8%ef%bc%89","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/6898","title":{"rendered":"Raspberry Pi \u3067\u6226\u8eca\u3092\u4f5c\u308b\uff08Bluetooth\/PS3 Dualshock3\u7de8\uff09"},"content":{"rendered":"<p>\nRasPi \u6226\u8eca\u306f\u3001PS3 Dualshock3 \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u64cd\u4f5c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3042\u308a\u307e\u3059\u3002\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u3067 WiFi \u7d4c\u7531\u3068\u304b Bluetooth \u7d4c\u7531\u304c\u591a\u3044\u4e2d\u3067\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u307e\u3042\u3001\u30e9\u30b8\u30b3\u30f3\u3068\u540c\u3058\u98a8\u306b\u6271\u3044\u305f\u304b\u3063\u305f\u304b\u3089\u3067\u3059\u3002\u3053\u308c\u3060\u3068\uff15\u6b73\u5150\u3067\u3082\u52d5\u304b\u305b\u307e\u3059\u304b\u3089\u306d\u3002PS3 Dualshock3 \u306b\u306f\u3001\u30a2\u30ca\u30ed\u30b0\u30b9\u30c6\u30a3\u30c3\u30af\u304c\uff12\u3064\u3068\u3001\u4e0a\u4e0b\u30dc\u30bf\u30f3\u3068\u25cb\u00d7\u30dc\u30bf\u30f3\uff14\u500b\u3068&#8230;\u8272\u3005\u3064\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u8eca\u8f2a\u3060\u3051\u3058\u3083\u306a\u3044\u5236\u5fa1\u304c\u3057\u3084\u3059\u3044\u305d\u3046\u3063\u3066\u306e\u3082\u3042\u308a\u307e\u3059\u3002\u30b5\u30fc\u30dc\u3092\u5236\u5fa1\u3057\u3066\u30ed\u30dc\u30c3\u30c8\u30a2\u30fc\u30e0\u3092\u52d5\u304b\u3059\u4e88\u5b9a\u3082\u3042\u3063\u3066\u3001\u3053\u308c\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\n<\/p>\n<p>\n\u304c\u3001\u53bb\u5e74\u8cb7\u3063\u3066\u307f\u3066\u3042\u307e\u308a\u6c4e\u7528\u7684\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u3069\u3046\u305b\u306a\u3089\u3070 Bluetooth \u5bfe\u5fdc\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u81ea\u4f5c\u3057\u305f\u307b\u3046\u304c\u3044\u3044\u306e\u3067\u3059\u304c&#8230;\u307e\u3042\u3001\u624b\u5143\u306b\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3002\u3061\u306a\u307f\u3001PS3 \u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306f\u6301\u3063\u3066\u3044\u308b\u3051\u3069\u3001PS3 \u672c\u4f53\u306f\u6301\u3063\u3066\u3044\u307e\u305b\u3093\u3002PS4 \u3082\u6301\u3063\u3066\u307e\u305b\u3093\u3002PS4 \u7528\u306e DualShock4 \u306e\u5834\u5408\u306f\u3069\u3046\u306a\u308b\u306e\u304b\uff1f\u306f\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3001\u6301\u3063\u3066\u3044\u308b\u65b9\u306f\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\n<\/p>\n<p><h2>Bluetooth \u306e\u6e96\u5099<\/h2>\n<\/p>\n<p>\n\u57fa\u672c\u306f\u3001\n<\/p>\n<p>\nBrickPi + LOGO Mindstorms EV3 \u3092\u30b2\u30fc\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\uff08\u524d\u7de8\uff09 | Moonmile Solutions Blog<br \/>\n<a href=\"http:\/\/www.moonmile.net\/blog\/archives\/5997\">http:\/\/www.moonmile.net\/blog\/archives\/5997<\/a>\n<\/p>\n<p>\n\u306b\u66f8\u3044\u3066\u3042\u308b\u624b\u9806\u306e\u901a\u308a\u306a\u306e\u3067\u3059\u304c\u3001\u304a\u3055\u3089\u3044\u3082\u517c\u306d\u3066\u3001\u3082\u3046\u4e00\u5ea6\u66f8\u304d\u9023\u306d\u3066\u304a\u304d\u307e\u3059\u3002RasPi \u306e\u30ec\u30dd\u30b8\u30c8\u30ea\u3082\u65b0\u3057\u304f\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3002\n<\/p>\n<p>\napt-get \u3067 bluetooth \u95a2\u9023\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nsudo apt-get install bluetooth bluez-utils bluez-compat bluez-hcidump\r\nsudo apt-get install libusb-dev libbluetooth-dev\r\n<\/pre>\n<p>\n\u57fa\u672c\u306f bluetooth \u3060\u3051\u3067\u3044\u3044\u306f\u305a\u3067\u3059\u304c\u3001\u5f8c\u306e QtSixA \u306e\u305f\u3081\u306b libusb-dev \u3042\u305f\u308a\u304c\u5fc5\u8981\u3067\u3059\u3002\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/etc\/init.d\/bluetooth status\r\n<\/pre>\n<p>\n\u3067\u3001\u304d\u3061\u3093\u3068 bluetooth \u30c7\u30fc\u30e2\u30f3\u304c\u52d5\u3044\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002\n<\/p>\n<p><a href='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_01org.jpg'><img border='0' src='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_01thum.jpg'\/><\/a><\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nlsusb\r\n<\/pre>\n<p>\n\u3067\u3001Bluetooth \u30c9\u30f3\u30b0\u30eb\u304c\u8a8d\u8b58\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3002\u3053\u3053\u3067\u306f\u3001Bus 001 Device 004 \u304c\u305d\u308c\u3067\u3059\u3002\n<\/p>\n<p><a href='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_02org.jpg'><img border='0' src='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_02thum.jpg'\/><\/a><\/p>\n<p><h2>QtSixA \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<\/p>\n<p>\nPS3 Dualshock3 \u7528\u306e\u30c9\u30e9\u30a4\u30d0\u30fc\u3092\u5165\u308c\u307e\u3059\u3002\n<\/p>\n<p>\nQtSixA &#8211; Browse \/QtSixA 1.5.1 at SourceForge.net<br \/>\n<a href=\"http:\/\/sourceforge.net\/projects\/qtsixa\/files\/QtSixA%201.5.1\/\">http:\/\/sourceforge.net\/projects\/qtsixa\/files\/QtSixA%201.5.1\/<\/a>\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\ntar -xvf QtSixA-1.5.1-src.tar.gz\r\ncd QtSixA-1.5.1\/sixad\r\nmake\r\nsudo make install \r\n<\/pre>\n<p>\n\u4eca\u306e\u74b0\u5883\u3067\u306f\u304d\u3061\u3093\u3068\u30d3\u30eb\u30c9\u3067\u304d\u3066\u3001sixpair \u307e\u3067\u51fa\u6765\u4e0a\u304c\u308a\u307e\u3059\u3002<br \/>\n\u4e2d\u8eab\u306f\u3001bluetooth SPP \u3092\u89e3\u6790\u3057\u3066\u3044\u308b\u3060\u3051\u3060\u304b\u3089\u3001C# \u3067\u66f8\u304d\u76f4\u3059\u306e\u306f\u305d\u3093\u306a\u306b\u96e3\u3057\u304f\u306f\u306a\u3044\u3068\u601d\u3046\u3093\u3067\u3059\u3088\u306d\u3002\u3053\u308c\u306f\u3001RasPi \u3067\u76f4\u63a5 Bluetooth \u3092\u6271\u3046\u3068\u304d\u306b\u8a66\u3057\u3066\u307f\u307e\u3059\u3002\n<\/p>\n<p><h2>PS3 Dualshock3 \u3068\u30da\u30a2\u30ea\u30f3\u30b0\u3059\u308b<\/h2>\n<\/p>\n<p>\n\u30b2\u30fc\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092 USB \u3067 RasPi \u306b\u3064\u306a\u3052\u3066\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nsudo sixpair\r\n<\/pre>\n<p>\n\u3092\u52d5\u304b\u3057\u307e\u3059\u3002\n<\/p>\n<p><a href='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_04org.jpg'><img border='0' src='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_04thum.jpg'\/><\/a><\/p>\n<p>\nBluetooth \u30c9\u30f3\u30b0\u30eb\u306e MAC ID \u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002MAC ID \u81ea\u4f53\u306f Windows 8.1 \u306e PC \u306b\u7e4b\u3044\u3067\u30c7\u30d0\u30a4\u30b9\u30de\u30cd\u30fc\u30b8\u30e3\u304b\u3089\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\n<\/p>\n<p><a href='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_03org.jpg'><img border='0' src='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2015\/03\/wpid-dworkblogimage20150303_03thum.jpg'\/><\/a><\/p>\n<p><h2>\u52d5\u4f5c\u3055\u305b\u308b\u3002<\/h2>\n<\/p>\n<p>\n\u30da\u30a2\u30ea\u30f3\u30b0\u81ea\u4f53\u306f\u3001\u6700\u521d\u3060\u3051\u306a\u306e\u3067\u3001\u305d\u306e\u5f8c\u306f\u30b2\u30fc\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e USB \u3092\u5916\u3057\u3066\u3082\u5927\u4e08\u592b\u3067\u3059\u3002\u78ba\u304b\u3001\u3064\u306a\u3052\u306a\u3044\u3067\u76f4\u63a5 MAC ID \u3092\u66f8\u304d\u8fbc\u3080\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u3002\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nsudo sixad -start &amp;\r\n<\/pre>\n<p>\n\u3055\u305b\u307e\u3059\u3002\u3046\u307e\u304f\u8d77\u52d5\u3057\u305f\u3089\u3001\u30b2\u30fc\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e PS \u30dc\u30bf\u30f3\u3092\u62bc\u305b\u3070\u63a5\u7d9a\u3067\u304d\u307e\u3059\u3002Dualshock3 \u306e MAC ID \u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\n<\/p>\n<p>\n\u901a\u4fe1\u60c5\u5831\u306f\u3001\/dev\/input\/js0 \u306b\u6d41\u308c\u3066\u304f\u308b\u306e\u3067\u3001\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nsudo cat \/dev\/input\/js0\r\n<\/pre>\n<p>\n\u63a5\u7d9a\u3092\u6b62\u3081\u308b\u5834\u5408\u306f\u3001\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nsixad -stop\r\n<\/pre>\n<p>\n\u3059\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u3002\n<\/p>\n<p><h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u901a\u4fe1\u3092\u89e3\u6790\u3059\u308b<\/h2>\n<\/p>\n<p>\n\u30c7\u30fc\u30bf\u81ea\u4f53\u306f\u4ee5\u4e0b\u306e\u69cb\u9020\u4f53\u3067\u6d41\u308c\u3066\u304d\u307e\u3059\u3002\u3053\u308c\u3092\u3046\u307e\u304f\u8aad\u307f\u53d6\u3063\u3066\u3084\u308c\u3070\u3001\u5404\u7a2e\u306e\u30dc\u30bf\u30f3\u306e\u5224\u5225\u304c\u3064\u304d\u307e\u3059\u3002\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\npublic struct js_event\r\n{\r\n\tpublic UInt32 time; \/* event timestamp in milliseconds *\/\r\n\tpublic Int16 value; \/* value *\/\r\n\tpublic byte type; \/* event type *\/\r\n\tpublic byte number; \/* axis\/button number *\/\r\n\tpublic override string ToString()\r\n\t{\r\n\t\treturn string.Format(&quot;time:{0} val:{1} type:{2} num:{3}&quot;, time, value, type, number);\r\n\t}\r\n}\r\n<\/pre>\n<p>\n\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9<br \/>\n<a href=\"https:\/\/gist.github.com\/moonmile\/7c44e5130617c7a76a87\">https:\/\/gist.github.com\/moonmile\/7c44e5130617c7a76a87<\/a>\n<\/p>\n<p>\n\u30dc\u30bf\u30f3\u306e\u5272\u308a\u5f53\u3066\u3092\u3057\u305f\u306e\u304c\u4e0a\u8a18\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u524d\u66f8\u3044\u305f\u3082\u306e\u3067\u3001\u30b8\u30e7\u30a4\u30b9\u30c6\u30a3\u30c3\u30af\u306e\u30c1\u30a7\u30c3\u30af\u3057\u304b\u3084\u3063\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u4eca\u56de\u306e RasPi \u6226\u8eca\u3067\u306f\u4e0a\u4e0b\u5de6\u53f3\u30dc\u30bf\u30f3\u306b\u3082\u5bfe\u5fdc\u3055\u305b\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<br \/>\n\u540c\u3058\u3082\u306e\u304c\u98db\u3093\u3067\u304d\u305f\u3089\u6368\u3066\u308b\u3088\u3046\u306a\u51e6\u7406\u3092\u5165\u308c\u308c\u3070\u3044\u3044\u306e\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RasPi \u6226\u8eca\u306f\u3001PS3 Dualshock3 \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u64cd\u4f5c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3042\u308a\u307e\u3059\u3002\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u3067 WiFi \u7d4c\u7531\u3068\u304b Bluetooth \u7d4c\u7531\u304c\u591a\u3044\u4e2d\u3067\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u307e\u3042\u3001\u30e9\u30b8\u30b3\u30f3\u3068\u540c &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/6898\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":5999,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[67],"tags":[],"class_list":["post-6898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberrypi"],"jetpack_featured_media_url":"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2014\/06\/title-raspi.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=6898"}],"version-history":[{"count":2,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6898\/revisions"}],"predecessor-version":[{"id":6900,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6898\/revisions\/6900"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media\/5999"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=6898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=6898"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=6898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}