TTGO-T Display i/o outputs

Good day.

Been baffled on this silly question perhaps as i cannot find any info on this issue or functionality for the inputs/outputs.
My big question today would be for the original TTGO-T display getting pins 32, 38 and 39 to work as an output.

As i have my code now, the TFT is working and showing green screen, detects when a button was pressed but not pulling pin 38 LOW

I tried various ways to to set pin 38 low even tried to test the input button with basic sketches for input/output but same similar results.
My code:

#include <Button2.h>
#include <Hardware.h>

#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <SPI.h>

#define TFT_MOSI 19
#define TFT_SCLK 18
#define TFT_CS 5
#define TFT_DC 16
#define TFT_RST 23
#define TFT_BL 4

uint8_t Button = 36;
uint8_t Pump = 38;
// tried: const int Pump = 38;
byte currentButtonState;

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

void setup() {
  Serial.begin(115200);
  pinMode(TFT_BL, OUTPUT);
  digitalWrite(TFT_BL, HIGH);
  tft.init(135, 240);
  tft.fillScreen(ST77XX_GREEN);

pinMode(Button, INPUT_PULLUP);
pinMode(Pump, OUTPUT);
digitalWrite(Pump, HIGH);

}

void loop() {

currentButtonState = digitalRead(Button);
if (currentButtonState == LOW) {
    digitalWrite(Pump, LOW);
    Serial.println("Relay Switched On");
        delay(5000);
        digitalWrite(Pump, HIGH);
            Serial.println("Relay Switched Off");
}
}

On the serial side looping every 5 seconds: E (667770) gpio: gpio_set_level(226): GPIO output gpio_num error
Relay Switched Off
E (667770) gpio: gpio_set_level(226): GPIO output gpio_num error
Relay Switched On

For the genuises out there to give me some pointers or code changes will be much appreciated.

I don't know the Arduino 101 which apparently is based on an Intel Curie chip. However, the documentation https://docs.arduino.cc/retired/boards/arduino-101-619 contains this statement: "The 101 comes with 14 digital input/output pins". That, together with the error messages you listed would cause me to question if the following are valid choices for IO pins:

uint8_t Button = 36;
uint8_t Pump = 38;

Have you seen any examples using these numbers and which physical pins on the 101 have you connected these to ?

And i posted in the wrong section...

It is not the Ardiuno 101 but a TTGO T - Display ESP32 board.
I did try int Pump = 38; also, same results

See here for which gpio pins you can safely use on an ESP32: ESP32 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials

Thanks for helping @6v6gt.
It seems it will not work as i anticipated looking at the chematic unless im wrong here.


In the end i will need 2 inputs and 4 outputs as 36, 37, 38, 39, 32 and 27 as per pcb markings

I have moved your topic to a more appropriate forum category.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.