🤖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

    Scheduled Pinned Locked Moved Arduino
    2 Posts 2 Posters 2.5k 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.
    • B Offline
      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 Offline
        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

        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