Can we use GPIO36 as Servo control pIn ?
-
Hello.
I'm trying to use M5Stack FIRE V2.7 portB(GND, 5V, GPIO26, GPIO36) as Servo motor control pin. The purpose is that two Servo motors ( SG-90 ) connected to portB can be controlled by software.
First of all, I tested one Servo motor connected to portB (GND, 5V, GPIO26) by using the following Arduino IDE sketch, and it works well.
But the same Servo motor connected to portB (GND, 5V, GPIO36) doesn't work by using the same Arduino IDE sketch with replacing pin number 26 to 36.
It seems that GPIO36 pin cannot be set to OUTPUT mode.#include <M5Stack.h> //Board : M5Stack-FIRE
#include <esp32-hal-ledc.h>
#define LOW 1500
#define HIGH 8500
#define TIMER_WIDTH 16
#define PIN 26 // PIN should be set to 36, if GPIO36 is usedvoid 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);
}
}I don't know the reason why GPIO36 cannot be used as Servo motor control pin.
Furthermore, I opened M5Stack FIRE cover, and connected Servo motor to GPIO pins directly, but the result is the same as ever.Please help, if you have any advice or information on it.
Thank you In advance.RuriObb
-
-
GPIO36が入力専用であることを理解しました。
情報をありがとうございました。RuriObb
-
@RuriObb No, it is an input pin only. as specified in the various my stack documents.