コントローラ側
M5Stack と Skywriter HAT はI2Cで接続してデータのやり取りを行っています。
受信した情報に基づき、画面にグラフィックで状態を表示しています。
距離に応じて、両サイドの黄色いバーを上下して表示する
ホイールに応じて、サークル内の三角形を回転表示する
ホイールの回転する向きに合わせて三角形をを回転させる
ジェスチャーに応じて矢印を表示する
ロボット側
ESP-NOWでM5Stackから情報を受信して、ザリガニ型ロボットを動かす。
受信する内容は「ジェスチャーで指示した向き」「デバイスまでの距離」です。
「ジェスチャーで指示した向き」で前進・後進・旋回の設定を行う。
「デバイスまでの距離」が近いと判断した場合、上記で設定した行動を行う。
「デバイスまでの距離」に応じで、腕の上げ下げを行う。
*** Controller side ***
M5Stack and Skywriter HAT are connected by I2C to exchange data.
The status is displayed graphically on the screen based on the received information.
The yellow bars on both sides are displayed up and down according to the distance. Rotate the triangle in the circle according to the wheel Rotate the triangle according to the direction of rotation of the wheel Show an arrow in response to a gesture.
*** Robot side ***
Receive information from M5Stack with ESP-NOW and move the crayfish type robot.
The contents to be received are "direction indicated by gesture" and "distance to device".
Set forward / backward / turn in the "direction indicated by gesture". If it is determined that the "distance to the device" is short, the action set above is performed. Arms are raised and lowered according to the "distance to the device".