ESP-WROOM-32 and ST7735, problem to show analog values #3062
Unanswered
Sadtanas1996
asked this question in
Q&A - General
Replies: 1 comment
-
Specify a background colour: You may need to add spaces to blank out old digits if the number of digits changes. Would be better to use drawString(), setTextDatum() and setTextPadding() functions. See examples. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, how are you? I'm trying to display analog values from a potentiometer on the ST7735/ST7789 TFT screen. When it comes to strings, everything works fine, but when I try to print the analog values, it only shows white boxes. Any idea why this might be happening?
this is my code:
#include<TFT_eSPI.h>
#define TFT_SCLK 18
#define TFT_MOSI 23
#define TFT_DC 2
#define TFT_RST 4
const int pinPot = 36;
int potValue = 0;
TFT_eSPI pantalla = TFT_eSPI();
void setup() {
Serial.begin(115200);
pantalla.init();
pantalla.fillScreen(TFT_BLACK);
}
void loop() {
pantalla.setCursor(60,0);
pantalla.setTextSize(2);
pantalla.setTextColor(TFT_WHITE);
pantalla.print("Informacion");
potValue = analogRead(pinPot);
String potText = String(potValue);
pantalla.setCursor(50,50);
pantalla.setTextSize(2);
pantalla.setTextColor(TFT_WHITE);
pantalla.print(potText);
Serial.println(potText);
}

Beta Was this translation helpful? Give feedback.
All reactions