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 1 year has passed since last update.

M5Stack Core2: UIFlow の使い方 (Blockly)

Last updated at Posted at 2022-06-06

blockly01.png

まず左の画面で、タイトル、テキスト、円を配置します。
image.png

次に右の画面で、ブロックを組みます。
変数は、x と y を使います。
blockly02.png

これに対応する Python のプログラムです。

from m5stack import *
from m5ui import *
from uiflow import *
import time

setScreenColor(0x222222)

x = None
y = None

Blockly = M5Title(title="Blockly Test", x=3, fgcolor=0xFFFFFF, bgcolor=0x0000FF)
circle0 = M5Circle(46, 182, 15, 0xFFFFFF, 0xFFFFFF)
label0 = M5TextBox(46, 57, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label1 = M5TextBox(45, 100, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)

x = 0
y = 0
while True:
  label0.setText(str(x))
  label1.setText(str(y))
  x = x + 1
  y = y + 2
  wait(1)
  wait_ms(2)

実行結果
IMG_20220606_135345.jpg

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?