🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5Stack Fire V2.7のGPIO36をサーボモータ制御に使えない件

    Scheduled Pinned Locked Moved 日本語フォーラム
    2 Posts 2 Posters 2.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      RuriObb
      last edited by

      こんにちは。

      M5Stack Fire V2.7のポートB(GND, 5V, GPIO26, GPIO36)にサーボモータ(SG-90)2個を接続しようと試行しています。
      まず、サーボモータを1個ずつ次のように接続し、動作を確認したところ、GPIO26に接続した場合には正しく動作しましたが、GPIO36に接続に接続した場合には正しく動作しませんでした(全く回転しない)。

      1. GPIO26にサーボモータの制御端子を接続した場合
          サーボモータ3端子に、GND, 5V, GPIO26を接続
      2. GPIO36にサーボモータの制御端子を接続した場合
          サーボモータ3端子に、GND, 5V, GPIO36を接続

      動作確認には、次のArduino IDEスケッチを使用しました。
      上記1)の場合は#define PIN 26、2)の場合は#define PIN 36。
      ちなみに、ボード設定はM5Stack-FIRE。

      #include <M5Stack.h>
      #include <esp32-hal-ledc.h>
      #define LOW 1500
      #define HIGH 8500
      #define TIMER_WIDTH 16
      #define PIN 26 // 2)の場合、PINは36

      void setup() {
      M5.begin();
      pinMode(PIN, OUTPUT);
      ledcSetup(1, 50, TIMER_WIDTH);
      ledcAttachPin(PIN, 1);
      }

      void loop() {
      for(int i = LOW; i < HIGH; i = i + 100) {
      ledcWrite(1, i);
      delay(100);
      }
      }

      関連ドキュメントを見ても、M5Stack Fire V2.7のポートBの
      GPIO36をこのような用途で使用できない旨の記述がなく、
      この問題を解決できず困っています。
      どなたかヘルプをお願いいたします。

      ※ もしかするとM5Stack Fire V2.7の内部コネクタとポートB
        との接続が悪いのかとも思い、内部のコネクタから直接
        サーボモータに接続しましたが、やはりGPIO26のほうは
        動作OK、GPIO36のほうは動作NGでした。
        また、他のGPIOピン、例えばGPIO5でも同様に確認した
        ところ動作OKでした。

      よろしくお願いします。

      RuriObb

      1 Reply Last reply Reply Quote 0
      • M Offline
        macsbug
        last edited by

        Fire v2.7 ( ESP32 )
        https://docs.m5stack.com/ja/core/fire_v2.7

        GPI26は DAC です。
        GPI36は ADC です。
        SENSOR_VP は GPIO36 として入力に使用します。
        GPIO34 ~ 39. は 入力専用です。

        スクリーンショット 2025-08-18 12.53.21.png

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post