ソース表示: 使用法 #40352

== class Wrj4P5 ==
=== Proce55ingのための[http://www.wiili.org/WiiremoteJ WiiRemoteJ]のラッピングライブラリー ===
{{{ Copyright (c) 2007 Classiclll

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General
 Public License along with this library; if not, write to the
 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 Boston, MA  02111-1307  USA
}}}
=== . ===
=== 使用上の注意 ===
{{{
WiiRemoteJ 1.4までとWiiRemoteJ 1.5のAPIが異なるため、次のような組み合わせしかうまく行かない。
 (スケッチの変更は不要)
 1.Wrj4P5の001〜005 + WiiremoteJのv0.9〜1.4
 2.Wrj4P5のalpha-006 + WiiremoteJのv1.5
さらに、Processing 1.0での環境変更のため?、(PPC Leopardで)複数リモコンをつかうには
 3.Wrj4P5のalpha-010 + Processing1.0.3+ + WiiremoteJ v1.6+ + BlueCove2.0.3
  *[PPC-LeopardでBlueCove-2.1.0はダメ]問題はalpha-011で対応完(リモコン側のJSR82非標準手順に対応)
}}}

=== 使用法 ===
''' 配布物 '''
 * Wrj4P5.jar  :ProcessingのためのWiiリモコン制御ライブラリー
 * [Loc].jar     :サポートライブラリー、位置とベクトルのモデル

''' レシビ '''
 * OS : Windows, Mac OSX, Linux
 * 最新の [http://processing.org/ Processing(Proce55ing)]
    * Wrj4P5 は jre 1.5以上で稼働する。WindowsでP5のJava付きバージョンを使用している場合は、Java無しバージョンと取り替える必要がある。
 * ブルートゥースのドングル(内蔵可)
 * [http://sourceforge.jp/projects/wrj4p5/wiki/Wrj4P5#h3-.E6.96.B0.E9.A1.94.E3.80.81.E3.83.90.E3.83.A9.E3.83.B3.E3.82.B9.E3.83.9C.E3.83.BC.E3.83.89 Wiiリモコン] (1 to 7)
 * [http://sourceforge.jp/projects/wrj4p5/wiki/Wrj4P5#h3-.E3.81.8A.E3.81.A4.E3.81.8E.E3.81.AF.E3.83.8C.E3.83.B3.E3.83.81.E3.83.A3.E3.82.AF Wiiヌンチャク] (0 to 7)
 * [http://sourceforge.jp/projects/wrj4p5/wiki/Wrj4P5#h3-.E3.81.8A.E3.81.A4.E3.81.8E.E3.81.AF.E3.82.AF.E3.83.A9.E3.82.B3.E3.83.B3 Wiiクラコン] (0 to 7)
 * [http://sourceforge.jp/projects/wrj4p5/wiki/Wrj4P5#h3-.E3.81.8A.E3.81.A4.E3.81.8E.E3.81.AF.E3.82.AE.E3.82.BF.E3.83.BC Wiiギター] (0 to 7)
 * [http://sourceforge.jp/projects/wrj4p5/wiki/Wrj4P5#h3-.E6.9C.80.E5.BE.8C.E3.81.AF.E6.96.B0.E9.A1.94.E3.81.AE.E3.83.89.E3.83.A9.E3.83.A0 Wiiドラム] (0 to 7)
 * [http://sourceforge.jp/projects/wrj4p5/wiki/Wrj4P5#h3-.E6.96.B0.E9.A1.94.E3.80.81.E3.83.90.E3.83.A9.E3.83.B3.E3.82.B9.E3.83.9C.E3.83.BC.E3.83.89 Wiiボード] (0 to 7)
 *  [http://www.wiili.org/WiiremoteJ WiiRemoteJ].jar
   * Wiiリモコンを制御する為の純粋Javaライブラリー。[http://www.wiili.org/ wiili.org]に棲むMr. cha0sが開発した。[http://www.wiili.org/forum/what-is-wiiremotej-t2356.html WiiRemoteJ forum]から結構ちゃんとしたJavaDocとともに、無償で入手できる。彼の方針に基づき、ソースコードは公開されていない。(飽きたら公開すると言ってる)
   * cha0s に感謝。
 *  JSR82実装ライブラリー(以下のいずれか)
   * avetanabluetooth.jar
     * Unixユーザー向けには[http://sourceforge.net/projects/avetanabt/ オープンソースとして公開]。
     * Windows/MacOSXユーザーには、有償の商用ライセンスとして、[http://www.avetana-gmbh.de/avetana-gmbh/jsr82.xml 25ユーロで販売中]。三つまでのドングルに対して最初の14日間は無償で使用可能だが、それをすぎると25ユーロで無制限のライセンス供与となる。
   * BlueCove.jar
     * WindowsとOSXユーザーにはオープンソースの[http://code.google.com/p/bluecove/ BlueCove]が利用可能
     * Linux版も現在開発中
		
''' インストール '''

設定は、[http://processing.org/ P5(Processing)]のインストールフォルダ配下のLibrariesフォルダに下記のように
格納する。この後P5を起動すると、Sketch->import..のリストに
[wrj4P5]と[Loc]が追加されるはず。

[http://processing.org/ Processing] スケッチフォルダー
...(your documents)/processing
 - (多くのスケッチフォルダ)

 - Libraries

   - candy

   - dxf

   - (多くのファイル)

   - [wrj4P5]

     - Library

       - avetanabluetooth.jar又はavetanaBT.jar又はBlueCove.jar

       - [http://www.wiili.org/index.php/WiiremoteJ WiiRemoteJ]j.jar

       - [wrj4P5].jar

   - [Loc]

     - Library

       - [Loc].jar

 * [Wrj4P5] は [http://processing.org/ Processing] に依存するが、 [Loc] は汎用


''' 最初は、WiiリモコンとPC とのペアリング '''
  1.  まずは、あなたのPCへ、ブルートゥース(BT)ドングルを挿入。
  2. BT-マネージャを起動(Macは標準、Winは?)
  3. Wiiリモコンのバッテリー格納部にある赤いボタンを押す。
  4. BT-マネージャでパスキー無しの「その他でバイス」を選択。
  * OS10.4.10じゃ、ペアリングは最初の一回でOK。(他もそうかも)


''' あなたのスケッチに接続 '''

スケッチを起動後、1ボタンと2ボタンを同時に押す。
 * isConnecting()でユーザーに接続待ちの状態をユーザーにフィードバックできる。


''' スケッチを終了させる '''

Wiiリモコンの電源ボタンを長押しする。その後、スケッチを終了させるほうがPCに優しいかも。


''' *Mac PPC(OSX)での注意事項 '''

PPC Macだけの問題だが、二回目の接続の前にBT-マネージャから認識中の「nintendo RVL-CNT-01」のエントリーを削除しておかないと、再認識しない場合が多い。