If I draw on the screen colours are correct but load image see attached photo and images are wrong colour anyone have some clue whats going on?
Ok, it is your second post.
Please post link to your screen e.g. Ebay sale
Any "Adapter shield" or photo of wiring.
Please say which library(s) you are using.
Please say which library example you are using.
If you customised the constructor, please paste your changes to the "library example"
Seriously. It takes you a minute or two to provide the information in your message.
But it generally means you get an accurate solution in a single reply.
David.
Your BuyDisplay link shows an obsolete UTFT library (v2.79). UTFT is currently v2.83
It also shows you how to connect to a 3.3V Arduino Due or 3.3V 8051 chip.
You say you are using a library called TFT_ST7735
Google can find Bodmer's TFT_ST7735
Google can find Sumotoy's TFT_ST7735
Google can find MBED (not Arduino) TFT_ST7735
There might be others called TFT_ST7735.
If the regular library examples are showing the correct colours I would expect a BMP example from the same library to produce the same colours.
If you have got examples mixed up, it is easy enough to invert the colours e.g. tft.invertDisplay(1);
David.
Screen only likes 5v thinks it has voltage converter built in
Invert still gives wrong colours see image
Bodmer's TFT_ST7735
Code im using attached
spitftbitmap.ino (11.6 KB)
I can only take you to the BuyDisplay documents. I can't make you follow their advice.
Your sketch has functions to display a BMP file e.g.
void drawBMP(char *filename, int x, int y, boolean flip) {
however your sketch only uses
void drawRAW(char *filename, int16_t x, int16_t y, int16_t rawWidth, int16_t rawHeight) {
as in:
//drawBMP("minibot.bmp", 0, 0, BU_BMP);
tft.invertDisplay(1);
delay(2000);
//tft.fillScreen(TFT_BLUE);
// Draw bmp image top left corner at x,y = 0,0
// Image must fit (one day I will add clipping... but it will slow things down)
drawRAW("minibot.raw", 0, 25, 160, 80);
I would be 100% confident with the unused "minibot.bmp"
I have no idea what is stored in "minibot.raw" but you can see that the screen has already been inverted.
(inverted colours mean BLACK instead of WHITE, MAGENTA instead of GREEN, ...)
I suggest that you view "minibot.bmp" on your PC. It should have good colours.
Then display it with drawBMP() and without invertDisplay()
David.
I need this one as its not 1-1 match of screen so need offset
void drawRAW(char *filename, int16_t x, int16_t y, int16_t rawWidth, int16_t rawHeight) {
raw is alternative have been messing around with code for ages will get a new sd card reader as believe it is causing the issue and hope
The first step is to display the BMP properly. You can find the minibot.bmp picture on the Adafruit tutorial page
Yes, we have shown you how to display it at a specific X, Y on the screen.
Yes, we can show you how to create a RAW file.
Yes, we have shown you how to invert or not-invert the colours in the display.
There is nothing wrong with your SD card reader.
David.
The Adafruit Tutorial works just fine.
- install Adafruit_ST7735 and Adafruit_GFX via IDE Library Manager
- copy the minibot.bmp picture from the Tutorial to your SD
- edit spitftbitmap example from Adafruit_ST7735 library to match MINI160x80 and filename.
Note that your display is natively Portrait 80x160 i.e. setRotation(0)
You need setRotation(1) for Landscape 160x80
The BMP is arranged as 80x160 (Portrait)
Any third party programs that create RAW files create the same Portrait geometry.
Where did you get the ??? Bodmer drawBMP() sketch?
It is always wise to link to the original example. I doubt if Bodmer would publish anything like this unless it is very OLD.
David.