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

    G20 as OUTPUT Stamp C3

    Arduino
    2
    2
    2.0k
    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.
    • B
      Berni4
      last edited by

      Hi,

      i have the Stap C3 and i like to use the Pin G20 as Output to drive a small LED. The LED get 3.3V and the Output should switch to low to activate the LED. i also have a series resistor (Same circuit is working fine in G21 and G7). My test program is verry simple:

      void setup() {
      // put your setup code here, to run once:
      pinMode(7, OUTPUT);
      pinMode(20, OUTPUT);
      pinMode(21, OUTPUT);
      digitalWrite(7, 0);
      digitalWrite(20, 0);
      digitalWrite(21, 0);
      }

      void loop() {
      // put your main code here, to run repeatedly:

      }

      only the LED on G7 and G21 is on. I think it have someting to do with the UART, becaus G20 is also RX. I´m sure the circuit is fine because the LED is flashing during the update process.

      Does anyone know how i switch G20 to Output mode?

      Gest regards,
      Berni4

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by felmue

        Hello @Berni4

        the C3' TX (GPIO21) is connected to the USB UART RX pin; in other words the C3 is driving the line, therefore your code can blink an LED on GPIO21 just fine.

        However the C3' RX (GPIO20) is connected to the USB UART TX pin; in this case the USB UART and the C3 are both trying to drive the line and it looks like the USB UART is winning.

        In short, without hardware modification I don't see a way to use GPIO20 for anything else than UART functionality.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • First post
          Last post