Is it possible to forward data from one GPIO (input) to another GPIO (output)?

stiw47
Posts: 1
Joined: Tue Jan 31, 2023 8:08 pm

Is it possible to forward data from one GPIO (input) to another GPIO (output)?

Postby stiw47 » Tue Jan 31, 2023 8:48 pm

Hi guys.

I made this LED matrix:

https://cloud.stiw47.cloud/s/S9zNRXafaXc8YDf

https://cloud.stiw47.cloud/s/q8ctk7SfYpXXpFz

Most of the code is from this guy here: https://github.com/s-marley/ESP32Matrix
I had wish to play games with PS4 controller instead with phone touch screen and I had success to implement it, so as my debt to community :D , I forked it here: https://github.com/stiw47/ESP32MatrixGa ... Controller

First of all I would like to say that I have zero to nothing knowledge in C++, and I am not a dev at all, but I am ok with code editing (so so).

Question: Let's say that I have one ESP32 board, where mentioned Arduino code is running. And let's say that I have another ESP32 board where WLED is installed. I want to "merge" these two boards :lol:
If you check my GitHub fork, this is something you will not find there, because I added it yesterday. Additional file Wled.h :

Code: Select all

// APP_WLED

class Wled {

  cLEDSprites Sprites;
  
  public:
  Wled():Sprites(&leds){};

  void setup() {
  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());
  FastLED.clear(true);
  delay(500);
  FastLED.showColor(CRGB::Black);
  }

  boolean loop() {
    if(PS4.isConnected()){
      if (PS4.Options()){
        currentApp = -1;
        return false;
        delay(500);
      }
    } 
    Serial.println(currentInput);
  }
  
};
At this moment, when WLED item is chosen from main menu, it will just turn off all LEDs, nothing else (void setup). Additionally, it will listen for "Options" button click from the PS4 controller, which will send it back to main menu (this is another file, Menu.h, and it is serving for game select. This file can be found on my GitHub fork).
Data output on my ESP32 is on GPIO0, i.e. PIN which is sending data to LED matrix. What I was thinking is to implement:
  • Get another ESP32 board with WLED installed and connect it's data output PIN to some free PIN on above mentioned ESP32 board
  • On above mentioned ESP32 board, read somehow input data and forward it as output to LED matrix via GPIO0 output PIN
I.e. is it possible to write some code inside boolean loop() above, which will simply forward data from one GPIO to another?
My apologize if I'm asking nonsense, as said before I am not some experienced user and not sure if this is possible.

Thanks in advance.

Who is online

Users browsing this forum: No registered users and 62 guests