I feel like I'm missing something that must be in the guides for this product, but I've been through those a couple of times and haven't found what I need. All I want to do (for now) is send plain text to this display, and have it scroll off screen once it's filled up. Eventually I'd like to emulate some basic terminal functions like repositioning the cursor.
I'm currently reading text from serial, and it's displaying fine via SPI, until it fills up the display, and then nothing changes. So I tried making a buffer to store the text contents and update the whole screen based on that. This worked, but it was excruciatingly slow by the time the screen filled up.
Can anyone steer me towards a guide relevant to this display to achieve this seemingly simple task?
3.5" TFT LCD HX8357D vertical scrolling text
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- SiliconBadger
- Posts: 5
- Joined: Sat Aug 26, 2017 3:13 am
- SiliconBadger
- Posts: 5
- Joined: Sat Aug 26, 2017 3:13 am
Re: 3.5" TFT LCD HX8357D vertical scrolling text
Anyone have ideas, any direction to help out a paying customer? Not looking for hand-holding, just thinking I must be overlooking something, or there must be some intermediate guides to working beyond what the HX8357 library is providing. Or is there something unclear about my question? I'm happy to provide more detail where needed.
- mikeysklar
- Posts: 14193
- Joined: Mon Aug 01, 2016 8:10 pm
Re: 3.5" TFT LCD HX8357D vertical scrolling text
@SiliconBadger,
Do you want to post your code that fills the screen and then stalls out? Maybe we can locate something.
Do you want to post your code that fills the screen and then stalls out? Maybe we can locate something.
- SiliconBadger
- Posts: 5
- Joined: Sat Aug 26, 2017 3:13 am
Re: 3.5" TFT LCD HX8357D vertical scrolling text
I don't have that particular code handy at the moment, but since you mentioned stalling out, I think we can just clarify one basic point. If my screen holds 40 lines of text at given settings, and I've set the cursor at top left, and then do this:
I expect to see each line have its respective line number printed in succession, all the way to 40. But once the loop goes past 40, should I expect line 1 to scroll off screen, so that the top line of the display now shows "2", and the bottom line shows "41"? It is my understanding that this should not happen, and that anything sent with println() after the bottom line has been printed will not be displayed.
If that's accurate, then nothing is really stalled; everything is working as designed, and I rather need some guidance on what different approach to use for implementing this.
Code: Select all
for (int i=1; i<=41; i++) {
tft.println(i);
delay(200);
}
If that's accurate, then nothing is really stalled; everything is working as designed, and I rather need some guidance on what different approach to use for implementing this.
- mikeysklar
- Posts: 14193
- Joined: Mon Aug 01, 2016 8:10 pm
Re: 3.5" TFT LCD HX8357D vertical scrolling text
yes, I would expect you to see exactly what you describe. When the loop completes line #2 will be the top and line #41 will be at the bottom. It works much like a terminal shell.
- SiliconBadger
- Posts: 5
- Joined: Sat Aug 26, 2017 3:13 am
Re: 3.5" TFT LCD HX8357D vertical scrolling text
Thanks for the clarification. I've made a basic test as described, and display doesn't change after line 40 is printed. I had been using the Teensy 3.2, but I just now set it up on an Arduino Nano and it's functioning the same.
Code: Select all
#include <Arduino.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Wire.h>
#include <Adafruit_HX8357.h>
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, TFT_RST);
int i = 1;
void setup() {
tft.begin();
tft.cp437(true);
tft.fillScreen(HX8357_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(HX8357_GREEN, HX8357_BLACK);
tft.setTextSize(1);
tft.setRotation(1);
}
void loop() {
delay(200);
tft.println(i);
i++;
}
- SiliconBadger
- Posts: 5
- Joined: Sat Aug 26, 2017 3:13 am
Re: 3.5" TFT LCD HX8357D vertical scrolling text
Just following up to see if there are any ideas as to why the example code doesn't automatically scroll the text off screen.
- BryonMiller
- Posts: 222
- Joined: Fri Mar 04, 2016 10:34 am
Re: 3.5" TFT LCD HX8357D vertical scrolling text
Last time I looked at GFX Libraries they did not have any scrolling support. Probably because it is non-trivial. You can roll your own. There's a discussion here that might help get you started.
Good Luck,
Bryon
Good Luck,
Bryon
Please be positive and constructive with your questions and comments.