Upgrade to Pro — share decks privately, control downloads, hide ads and more …

M5UnifiedとPicoRubyで楽しむM5シリーズ

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

 M5UnifiedとPicoRubyで楽しむM5シリーズ

Avatar for Katsuhiko Kageyama

Katsuhiko Kageyama

November 29, 2025
Tweet

More Decks by Katsuhiko Kageyama

Other Decks in Technology

Transcript

  1. M5Stack向けのライブラリをgem化しよう • 標準ライブラリ(M5Unified/M5GFX) ◦ 画面描画 ◦ LED ◦ ボタン ◦

    電源 ◦ IMU ◦ スピーカー ◦ マイク ◦ etc https://docs.m5stack.com/ja/arduino/m5unified/helloworld
  2. たくさんのメソッド 描画系(M5GFX)だけで100個以上! バインディングを書く必要あり void drawPixel ( int32_t x, int32_t y,

    const T& color) void drawCircle ( int32_t x, int32_t y, int32_t r, const T& color) … … … さすがに無理・・・
  3. 実装 1. 実装対象の関数をC++ヘッダからスクリプト で抽出 2. 抽出した結果をYAMLにまとめる 3. YAMLからmrubyバインディングのスケルト ン関数を生成 4.

    スケルトン関数を段階的に実装 作業量が多いので、そのままではAIでも対応できない ◆実装方針
  4. 現在の結果 描画系 99/180 メソッドを実装 - M5Unified Core: 20/20 (100%) ✅

    - M5GFX Color: 12/12 (100%) ✅ - M5GFX Draw: 30/30 (100%) ✅ - M5GFX Fill: 3/13 (23%) - M5GFX Text: 9/31 (29%) - M5GFX Image: 2/13 (15%) - M5GFX Display: 9/29 (31%) - M5GFX Low-level: 4/18 (22%) - M5GFX Utility: 0/13 (0%) https://github.com/kishima/picoruby-m5unified/tree/main