vbee155
February 17, 2024, 7:29pm
1
Hi! PLEASE ANY SUGGESTIONS I am trying to make a small video appear on a 2inch LCD screen and I need some help fixing it.
This is my set up:
pins as follows:
VCC -> 5V
GND -> GND
(MOSI) DIN -> D7
(MISO) CLK -> D6
CS -> D8
DC -> D3
RST -> D4
BL -> NOT CONNECTED
this is my lcd screen:
Amazon.com: waveshare General 2inch IPS LCD Display Module 240×320 Resolution 2.0inch Monitor Embedded Controller RGB, 262K Color Display Color LED Backlight ST7789 Driver SPI Interface : Electronics
and this is my code:
#include <TFT_eSPI.h> // Install this library via Arduino Library Manager
// Define pins
#define TFT_CS D8
#define TFT_DC D3
#define TFT_RST D4
TFT_eSPI tft = TFT_eSPI(); // Create TFT object
void setup() {
tft.init(); // Initialize TFT display
tft.setRotation(1); // Set display rotation (0, 1, 2, or 3)
// Fill screen with a color (optional)
tft.fillScreen(TFT_BLACK);
// Display the file path
tft.setTextSize(2);
tft.setTextColor(TFT_WHITE);
tft.setCursor(10, 50);
tft.println("Video File Path:");
tft.setCursor(10, 80);
tft.println("/path/to/your/video.mp4"); // Replace with your actual file path
}
void loop() {
// Your main code here (if needed)
}
vbee155
February 17, 2024, 7:30pm
2
Also to be clear, it's saying:
Sketch uses 34824 bytes (107%) of program storage space. Maximum is 32256 bytes.
Global variables use 294 bytes (14%) of dynamic memory, leaving 1754 bytes for local variables. Maximum is 2048 bytes.
Which board are you compiling for, and is that board set correctly in the IDE?
vbee155
February 17, 2024, 7:45pm
4
I'm using Arduino Uno R3 and I am pretty sure it's set correctly
xfpd
February 17, 2024, 8:24pm
5
I get a similar report on my Nano (113%). I suppose the library file is meant for MEGA or ESP32
Sketch uses 34824 bytes (113%) of program storage space. Maximum is 30720 bytes.
Global variables use 294 bytes (14%) of dynamic memory, leaving 1754 bytes for local variables. Maximum is 2048 bytes.
Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it.
text section exceeds available space in board
The library assumes something with large memory...
[...cut]TFT_eSPI\Extensions/Smooth_font.cpp:327:40: warning: left shift count >= width of type [-Wshift-count-overflow]
val = pgm_read_byte(fontPtr++) << 24;
vbee155
February 17, 2024, 8:29pm
6
Ohh okay so should I buy a mega?
I'm going to try attaching multiple screens at some point so I assume I'll need a lot more memory.
xfpd
February 17, 2024, 8:37pm
7
vbee155:
should I buy
No. You should find what you need. If you can use a different library (there are plenty that fit in a Nano/Uno), that would be good. It all depends on your needs.
vbee155
February 17, 2024, 9:38pm
8
Okay I changed libraries and my new code is:
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
// Define pins
#define TFT_CS 8
#define TFT_DC 3
#define TFT_RST 4
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup() {
tft.initR(INITR_BLACKTAB); // Initialize TFT display
tft.setRotation(1); // Set display rotation (0, 1, 2, or 3)
// Fill screen with a color (optional)
tft.fillScreen(ST7735_BLACK);
// Display the file path
tft.setTextSize(2);
tft.setTextColor(ST7735_WHITE);
tft.setCursor(10, 50);
tft.println("Video File Path:");
tft.setCursor(10, 80);
tft.println("Users\\14155\\Desktop\\RSSET.mov"); // Replace with your actual file path
}
void loop() {
// Your main code here (if needed)
}
It's uploading which is a big step in the right direction!! (thank you)
but.. the screen is just showing black.
any ideas?
it was also recommended to me that I move the BL pin to 3.3v and the VCC to 5v
xfpd
February 17, 2024, 10:16pm
9
vbee155:
Adafruit_ST7735.h
When you installed the library, it created an example folder. In your IDE >> FILES >> EXAMPLES >> ADAFRUIT ST77XX >> (some example). See how the examples set up the TFT and do their graphics or text.
vbee155
February 17, 2024, 10:26pm
10
I tried that and it ended up showing a lot of errors but I will try again later tonight
xfpd
February 17, 2024, 10:31pm
11
Posting the errors will help.
xfpd
February 17, 2024, 11:19pm
12
vbee155:
try again later tonight
You started another topic of the same subject. That tells me that I am no longer needed.
vbee155
February 18, 2024, 1:34am
13
it was a new problem so I started a new more accurate post sorry
vbee155
February 17, 2024, 9:45pm
14
Hi! this is kind of an evolution of an old post because it was no longer in the right category..
My screen is just showing black and I can't figure out how to fix it! please help- any suggestions are welcome but I don't have a Potentiometer
I have the following LCD screen:
Amazon.com: waveshare General 2inch IPS LCD Display Module 240×320 Resolution 2.0inch Monitor Embedded Controller RGB, 262K Color Display Color LED Backlight ST7789 Driver SPI Interface : Electronics
and I am using the Aruino egloo uno R3
my pins are:
VCC -> 5V
GND -> GND
(MOSI) DIN -> D7
(MISO) CLK -> D6
CS -> D8
DC -> D3
RST -> D4
BL -> 3.3V
and my code is:
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
// Define pins
#define TFT_CS 8
#define TFT_DC 3
#define TFT_RST 4
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup() {
tft.initR(INITR_BLACKTAB); // Initialize TFT display
tft.setRotation(1); // Set display rotation (0, 1, 2, or 3)
// Fill screen with a color (optional)
tft.fillScreen(ST7735_BLACK);
// Display the file path
tft.setTextSize(2);
tft.setTextColor(ST7735_WHITE);
tft.setCursor(10, 50);
tft.println("Video File Path:");
tft.setCursor(10, 80);
tft.println("Users\\14155\\Desktop\\RSSET.mov"); // Replace with your actual file path
}
void loop() {
// Your main code here (if needed)
}
cherk
February 17, 2024, 11:19pm
16
Suggest using the correct library for the LCD driver.
ie: ST7789 NOT <Adafruit_ST7735.h> and follow the pin setup as per the data in the linked information.
vbee155
February 18, 2024, 1:35am
17
Okay I will try- the library that I originally used was too big for the board so it was recommended that I try this one
hammy
February 18, 2024, 8:35am
18
Wire and use as per the library examples first , then you’ll know if you have a hardware issue .
Use you boards default SPI connections
PaulRB
February 18, 2024, 8:41am
19
So it's kind of cross-posting, which is kind of against forum rules....
Topics can be moved between categories. Just ask.
vbee155
February 20, 2024, 12:48am
20
Okay using the examples I've gotten pretty far.
But, the screen is just showing like basically TV static. It was showing the example drawings well but I can't get it to corporate with my image path.
I've been trying to teach myself so sorry if I am going about this very wrong.
This is my new code:
#include <SPI.h>
#include "LCD_Driver.h"
#include "GUI_Paint.h"
#include "image.h"
void setup()
{
Config_Init();
LCD_Init();
Paint_DrawImage("Users\14155\Desktop\digole sun.bin",1, 1, LCD_WIDTH, LCD_HEIGHT);
//Paint_DrawFloatNum (5, 150 ,987.654321,4, &Font20, WHITE, LIGHTGREEN);
Serial.println("Debug message");
}
void loop()
{
}