-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screen alignment #6
Comments
In fact, I found the lib TFT_eSPI by Bodmer and it is THE lib to use! #define ST7735_DRIVER And then, it is just work great and really fast! |
This is about 10 times faster than the example the board came with :
(on my board, the fps is about 60) |
I'm using the adafruit lib like this:
`#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
#define TFT_RST -1
#define TFT_SCLK 5
#define TFT_CS 16
#define TFT_DC 17
#define TFT_MOSI 23
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
void box (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t color) {
for(uint8_t i=x; i<(x+width); i++)
for(uint8_t j=y;j<(y+height);j++)
tft.drawPixel(i, j, color);
}
void setup() {
tft.initR(INITR_BLACKTAB);
tft.fillScreen(ST7735_BLACK);
box(0,0,17,17,ST7735_CYAN);
box(1,1,15,15,ST7735_RED);
box(2,2,13,13,ST7735_WHITE);
box(3,3,11,11,ST7735_BLUE);
}
`
Display on the left start with white (missing cyan and red), and on top with red (missing cyan). And there is also garbage on the screen at right and bottom as fillscreen ... don't fill the screen.
Do you have the same problem?
The text was updated successfully, but these errors were encountered: