diff --git a/README.md b/README.md index 196ff11..eb3b13b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,50 @@ VID=0x0f0d, PID=0x0092 へ変更してボードへ書き込んでください。 変更方法はボードによって異なりますが、SparkFun Pro Micro の場合、下記ファイルを変更してください。 `~/Library/Arduino15/packages/SparkFun/hardware/avr/1.1.12/boards.txt` +## 操作方法 + +メソッドの定義は `SwitchControlLibrary.h` を参照。 + +- ボタンを押す + + ``` + // Aボタンを押す + SwitchControlLibrary().PressButtonA(); + ``` + +- ボタンを離す + + ``` + // Aボタンを離す + SwitchControlLibrary().ReleaseButtonA(); + ``` + +- ハット + + Hat の定義は `SwitchControlLibrary.h` を参照。 + + ``` + // ハットを左へ + SwitchControlLibrary().MoveHat(Hat::LEFT); + ``` + +* スティック + + Stick の定義は `SwitchControlLibrary.h` を参照。 + + ``` + // MoveLeftStick(uint8_t lx, uint8_t ly); + // lx x軸座標(0〜255) + // ly y軸座標(0〜255) + // 値が 0, 128, 255 の場合、Stick Enumを利用できます。 + + // 左スティックを左へ(数値の場合) + SwitchControlLibrary().MoveLeftStick(0, 128); + + // 左スティックを左へ(Stick Enum利用時) + SwitchControlLibrary().MoveLeftStick(Stick::MIN, Stick::CENTER); + ``` + ## ライセンス [MIT](https://github.com/celclow/SwitchControlLibrary/blob/master/LICENSE)