DXモンスターボール

© CC BY 4+ visibility328
© CC BY 4+
visibility328

【ボールを投げて、ポケモンをゲットしよう!】
M5StickCが入ったボールを投げると、動く!鳴る!
ポケモンマスターに、君もなろう!

link https://github.com/nekopath-dev/dxmonsterball
動画
開発素材

ツール

API

システム構成
system image
  1. 加速度センサーで投げを検知

  2. モーターが3回動く(本家で3回揺れるのを真似。モーターをバイブレーションとして使用)

  3. 70%の確率で成功、30%の確率で失敗分岐

(失敗の場合は、LINEに「逃げられてしまった...」を送信し、ブブーという音を出す)

  1. 成功の場合は、PokeAPIからポケモン名の取得を試行する (成功率が悪く3回失敗すると、獲得失敗となる)

  2. 成功した場合は、ポケモンゲットの効果音とともに、LINEに「やった!〇〇(ポケモン名)をゲットした!」と送信する

  3. 1に戻る

Detect throwing with an accelerometer sensor

The motor moves three times (imitating the original where it shakes three times; using the motor as a vibrator)

70% chance of success, 30% chance of failure branching (In case of failure, send "It got away..." to LINE and play a buzzer sound)

In case of success, attempt to retrieve the Pokémon name from the PokeAPI (if it fails three times, the capture fails)

If successful, play the Pokémon capture sound effect and send "Got it! I caught [Pokémon name]!" to LINE

Return to step 1

ストーリー

広島工業大学の講義で、初めてM5StickCを触り、最終課題で「DXモンスターボール」のグループ制作を行いました。

どうせ作るのならみんなが理解でき、さらにおもしろいと感じてもらえるものはないかと考えた結果、「ポケモンをゲットできるようなおもちゃにしよう!」と考えつきました。

講義で教えていただいた内容や、Google検索、生成AI等を駆使して制作したDXモンスターボールは、コードが317行にも及び、本格的なプログラミングが初めてだったコード担当はとても苦労しました。ただ、とても納得の行くものが制作できたと感じています。

苦労した点として、スピーカーとモーターが何故か連動してしまうという問題がありました。 生成AIでも解決できず、何が問題かメンバー全員でコードを一つ一つ実行し、原因を特定しました。 M5StickCにモーターとスピーカーを、同時に認識させているのが原因のようだったので GitHubのコードを見ると分かるのですが、一回一回使う前にセットアップのコードがあって、使い終わったら切断するコードを書いています。この原因を見つけ出して解決するのに7時間ほどかかりました。

とてもおもしろいと思っていただけるような作品を制作できたと感じています。 ぜひ皆さんも、作ってみてはいかがでしょうか?ポケモン、ゲットだぜ!!

追記

今少し後悔があるとするならば、もっとボールをモンスターボールっぽく色を塗ればよかったなと感じています。


In a lecture at Hiroshima Institute of Technology, we used the M5StickC for the first time and undertook a group project for our final assignment to create a "DX Monster Ball."

Wanting to make something everyone could understand and find enjoyable, we came up with the idea of creating a toy that could capture Pokémon.

Using the content taught in the lecture, Google searches, and generative AI, we created the DX Monster Ball. The code extended to 317 lines, and as someone handling such extensive programming for the first time, it was quite challenging. However, I feel that we were able to produce something we were very satisfied with.

One difficulty we encountered was that the speaker and motor would somehow activate together. Even with generative AI, we couldn't solve the issue, so the entire team went through the code line by line to identify the cause. It appeared that the issue was due to the M5StickC recognizing both the motor and speaker simultaneously. As you can see from our GitHub code, we wrote setup code to initialize each component before use and disconnection code to turn them off afterward. It took about 7 hours to identify and resolve this issue.

We feel that we were able to create a project that people would find very interesting. We encourage everyone to give it a try too! Let's catch some Pokémon!

Postscript: If there's anything we regret, it would be that we should have painted the ball to look more like a real Monster Ball.

メンバー
  • user
    nekopath @nekopath

関連イベント
  • event M5Stack Japan Creativity Contest 20242024-06-01 開催

同じニオイがする作品
  • event reNavigator: GPSナビ+Groveセンサ+AI機能拡張モジュール
  • event ドッキング!Atom-Chan
  • event ラズパイ×Slackで不審者撃退
  • event Tsu☆ぼやき

作品を登録しよう

モノづくりしている人に、つくった作品を見てもらえ、リアクションがもらえるかも?

close

目次