1
0

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 3 years have passed since last update.

【ポケモン剣盾・マイコン】Arduinoを使用して卵孵化を自動化

Last updated at Posted at 2021-09-08

#まえがき
この記事はAruinoLeonardを使用して北米版剣で卵孵化の自動化を実行したところうまく動作しなかったため、そのための覚え書きです。

参考サイト

###起こった問題

こちらのサイトのコードを実行したところ下の動画のようにタウンマップを開くだけで止まってしまった。

Videotogif.gif

###解決法
上から順番に動作確認したところ、空飛ぶタクシーでハシノマはらっぱに移動する関数moveToInitialPlayerPosition() のpushButton(Button::A, 450, 2);がうまく実行されていなかった。

hatch-eggs-in-the-box.ino
// 空飛ぶタクシーでハシノマはらっぱに移動する関数
void moveToInitialPlayerPosition() {
    pushButton(Button::A, 2000);
    pushButton(Button::A, 450, 2);//ここがうまく実行されていない
    delay(2200);  // 天候によって読み込み時間がやや異なる(最も重かった砂嵐でも1900で安定していたが、柱の本数や服装などの環境による差異がある可能性も考慮して少し余裕を持たせた)
}

おそらく北米版のためロトムの文字表示が日本語より多く、待機時間が足りなかったのではないかと予想した。

hatch-eggs-in-the-box.ino
// 空飛ぶタクシーでハシノマはらっぱに移動する関数
void moveToInitialPlayerPosition() {
  pushButton(Button::A, 2000);
  pushButton(Button::A, 1000);
  pushButton(Button::A, 2200);
}

待機時間を増やしたらうまく動作した。
Videotogif2.gif

#まとめ
北米版剣はテキストの量が日本語と違うため、待機時間が変わる場合がある。

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?