M5bitLess label & data extension

© CC BY 4+ visibility3835
© CC BY 4+
visibility3835

M5bitLess label & data extension can send and receive special data between Scratch and M5Stack.

link https://github.com/610t/M5bit-less/tree/demo
動画
開発素材
システム構成
system image

System of M5bitLess label & data extension is shown at this figure.

  • Scratch and M5Stack connect via Bluetooth using Microbit More protocol.
  • Using M5bitLess, M5Stack behave like micro:bit for Microbit More.
  • You can use many kind of Microbit More blocks at M5Stack.
  • Using M5bitLess label & data extension, you can send & receive string or numeric data with label between Scrath and M5Stack.

M5bitLess label & data拡張のシステムは、図のようになります。

  • ScratchとM5Stackは、Bluetooth経由で、Microbit Moreプロトコルで接続されます。
  • M5bitLessを使うことで、M5Stackは、Microbit More用のmicro:bitとして振る舞います。
  • M5Stackで、Microbit Moreのブロックの多くが利用できます。
  • M5bitLess label & data拡張を使うと、ScratchとM5Stackの間で、文字列や数値データのlabelとdataを送受信できます。
ストーリー

Scratch & extension

Scratch

Scratch is a programming language with block programming. Scratch3 can extend with scratch extension.

Scratchはブロックプログラミング言語です。 Scratch3は拡張機能で拡張できます。

Stretch3 extensions

The unofficial Scratch server named Stretch3 has many unofficial extensions including hardware (micro:bit, AkaDako, LEGO, ...), AI (Machine Learning, Pose detection, ...), and so on. Of cource Microbit More can use at Stretch3 shown as red rectangle.

Stretch3という非公式Scratchサーバは、多くの非公式拡張機能を提供しています。 これには、ハードウエアに関するもの(micro:bit, AkaDako, LEGO, ...)やAIに関するもの(機械学習,ポーズ検出, ...)などがあります。 Microbit Moreも、図の赤枠で囲んだように、Stretch3で利用できます。

Microbit More extension

Microbit More extension

Microbit More is extension for using micro:bit and Scratch each other. Microbit More can handle all micro:bit function.

Microbit More は、micro:bitとScratchをお互いに使うための拡張機能です。 Microbit Moreは、micro:bitの全ての機能が利用可能です。

Microbit More label & data

Microbit More have label & data command with 3 type blocks.

  • when data with label (label-01) received from micro:bit
  • data of label (label-01)
  • send data (data) with label (label-01) to micro:bit

Microbit Moreには、labelとdataコマンドのための3種類のブロックがあります。

  • micro:bitからラベル (label-01) のデータを受け取ったとき
  • ラベル(label-01)のデータ
  • micro:bitへデータ (data) にラベル (label-01) を付けて送る

The label & data means two type of message.

  • Send variable named "label" with the value "data".
  • Send event "label" (don't care "data").

ラベルとデータは、2種類のメッセージを意味します。

  • "label"という名前のついた変数の、その値"data"。
  • "label"というイベントを送る("data"を利用しない)。

M5bitLess for Microbit More extension

M5bitLess for Microbit More extension

M5bitLess is an Arduino program for interacting Scratch and M5Stack. M5bitLess behave as micro:bit for Microbit More, so you can use Microbit More extension. However, only micro:bit equivalent functions can be used, so for example, only 5x5 LED-like screen displays can be used with the standard block.

M5bitLessは、ScratchとM5Stackで相互にやり取りするためのArduinoプログラムです。 M5bitLess は、Microbit More用のmicro:bitとして振る舞うので、Microbit More拡張機能を使うことができます。 ただし、micro:bit相当の機能しか使えないため、例えば画面表示は5x5LED風のものしか標準のブロックでは使えません。

Microbit More & M5bitLess blocks

In this figure, of all the Microbit More blocks, the block circled by the red rectangle is implemented in M5bitLess. The blocks shown in light red are for handling label&data.

この図では、すべてのMicrobit Moreのブロックが記述されており、赤い四角形で囲まれたブロックがM5bitLessで実装されています。 薄い赤色で示したブロックが、label&dataを扱うためのブロックになります。

M5bitLess label & data extension

The M5bitLess label & data extension is an extension to Microbit More's label and data functionality that allows M5Stack to use features that cannot be achieved with Microbit More's standard blocks.

M5bitLess label & data拡張は、Microbit Moreのlabelとdataの機能を利用して、Microbit Moreの標準的なブロックでは実現できない機能をM5Stackで利用するための拡張です。

Currently, we are implementing a function to draw on the M5Stack display and a function to retrieve keyboard input from the M5Stack.

現在は、M5Stackのディスプレイ上に描画する機能と、M5Stackのキーボード入力を取得する機能を実装しています。

Draw object from Scratch to M5Stack

Example of M5bitLess label & data extension from Scratch to M5Stack

From Scrath to M5Stack, I implement draw picture command. This figure shows how to draw circle at position (x0(=80),y0(=80)), radius r(=80), and color c(=65524).

ScratchからM5Stackへは、描画コマンドを実装しています。 この図では、位置(x0(=80), y0(=80))、半径r(=80)、色c(=65524)の円の書き方を示しています。

Input key code from M5Stack to Scratch

Example of M5bitLess label & data extension from M5Stack to Scratch

From M5Stack to Scratch, I implement send key code pressed at keyboard. This figure shows send key code "q" with label "Key" and data "q", and the cat says "q".

M5StackからScratchへは、キーボードで押されたキーコードの送信を実装しました。 図では、ラベル"Key"にdata"q"を送り、猫が"q"と言います。

Example of M5bitLess label & data extension

In this section, I show some examples using M5bitLess label & data extension.

ここでは、M5bitLessのlabel&data拡張を使ったいくつかの例をお見せします。

Draw heart at M5Stack display

Draw heart at M5Stack display using label & data extension. This code draw two circles and one triangle, and string "Heart!!".

label&data拡張を使って、M5Stackの画面にハートを描画します。

https://www.youtube.com/watch?v=Vk8FoH25KJg

Draw Heart

Draw random circles, rectangles, and characters

Draw circles, rectangles, and string "M5bitLess" location, color, and size randomly.

円や四角形や文字列"M5bitLess"を、位置や色や大きさをランダムに変えて描画します。

https://www.youtube.com/watch?v=FYaJ7QR_N-g

Draw random object

Chase face using face mesh extension

Use the Facemesh extension to detect the nose position, move the cat there, and draw a circle on the M5Stack.

Facemesh拡張機能を使って鼻の位置を検出し、猫をそこに動かすとともに、M5Stackに円を描きます。

https://www.youtube.com/watch?v=SkgIeSZohBQ

Chase the face with facemesh

Conclusion

You can play Scratch and M5Stack with M5bitLess. The demo branch of M5bitLess github can handle display drawing & key press event.

M5bitLessを使うことで、ScratchとM5Stackで遊ぶことができます。 M5bitLessのgithubのdemoブランチは、描画やキー入力を取り扱うことができます。

Let's play M5bitLess and it’s label & data extension!!

M5bitLessとlabel&data拡張で遊んでね!!

Jimmy's comment

From 24:16. https://www.youtube.com/watch?v=EiLaip5sLhk&t=1456s

About this project

M5Stack Japan Creativity Contest 2022

This project is for M5Stack Japan Creativity Contest 2022.

メンバー
  • user
    むとうたけし @610t
    • Engineer/Programmer

関連イベント
  • event M5Stack Japan Creativity Contest 20222022-07-15 開催
関連リンク

同じニオイがする作品
  • event サイバー猫トイレ通知機
  • event 宇宙海賊王に俺は+スロットルコントローラ+サイバーチック発射ボタン
  • event AIスタックチャンミニマルProto化版とtoioの素敵な関係
  • event WATASHI.自己紹介が苦手な「私」。ChatGPTで克服!

Proto lovers ♥
user
user
user

作品を登録しよう

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

close

目次


Proto lovers ♥
user
user
user