monochrome/256colors/16colors bitmap on the official Arduino TFT?

well, hello this is my first post ^^

i've been using arduinos for around 4 year and finally got myself the official tft

after a few tests programs i have now started to create my own program

a basic "animation" player

it can be done by de-compiling a video file into many .bmp files and playing them on the lcd in the right order

the code itself would first load a frame, display it, then load the next frame, display it, etc.

the only problem is that the arduino takes a lot of time to display a bitmap, since it is encoded in 24 bits

i tried to load a monochrome, a 16 colors, a 256 colors and a 24 bits bitmap, and only the last one works

so, here's my question: how can I load a monochrome, 16 colors or 256 colors bitmap to display it on the official arduino tft?

sorry for my bad english, i'm french x3

BMP files can use several different formats. Using Monochrome or a 256-colour Palette will reduce the file sizes. And is simple to use. You can use a 16-colour Palette. Even using 16-bits instead of a 24-bit BMP saves memory (and has 65536 colours).

Unfortunately, most Arduino sketches and libraries are only designed for 24-bit BMP.

David.

Thank you, David

but, can the official arduino TFT Library load monochrome bitmaps?

i tried to print a simple 160x128 monochrome bitmap on my TFT using the TFTBitmapLogo example sketch, but it kept telling me that it had an "invalid pixel format" on the serial display, thus preventing it from printing the picture on the screen

Post a link to your code. And to the actual pictures that you want to show.

I am not sure what controller or which library you are using. It should be simple enough to write a sketch for you.

Most libraries might do a monochrome bitmap. Some might even understand the whole BMP format. I suspect that you need the PC to process a video file.

How do you get to be French x3 ?

David.

Edit. Just looked. It is a 128x160 screen with a ST7735 controller using SPI. So you can store unlimited files on the SD and handLe SD and TFT via hardware SPI.

Well, i didn't even change the code, i just ran the TFTBitmapLogo example included in the Arduino IDE on my arduino MEGA 2560 (the screen itself and the sdcard reader both works) with my own monochrome bitmap instead of the included arduino logo bitmap on the sd card

As i said, i'm currently working with an arduino MEGA 2650, and a fresh arduino install (i re-installed it a couple minutes ago), so i'm using the original arduino examples and libraries

(i'm not "French x3", i'm just French. "x3" is just an emoticon)

and, that's how my project will work, by loading bitmaps and sounds from the SD card

Tccolin70

EDIT: after some ressearch, i have found that in the LoadImage() fonction's reference, it says that "It is possible to load 24 bit bmp image only."

so, do you know any alternate library for this lcd that supports loading bitmaps from an SD card?

Yes, the Adafruit_ST7735 library will do most things.

There will be several other libraries for this popular controller.

David.

Hello,
after a lot of struggling where i had to learn how to use the Adafruit_GFX and Adafruit_ST7735 libraries, i have finally made a small monochrome bitmap animation,

the only problem is that i have to include the bitmaps in the PROGMEM, which is kind of annoying, since i need to load the frames from the SD card

I tried to remove the PROGMEM flag from the variables holding the animation, and it showed up some weird glitched picture that totally didn't look like the original pictures when i tried to run the program

Is there any way to not use the PROGMEM flag so i could load the frames from a file without having some glitched pictures?

Thanks,
Tccolin70

PS: once again, sorry for my bad english, i only slept for 4 hours

Sleep is good for you.
Tea is good for you.

Yes, you can load bitmaps from SD card or anywhere else. I doubt if every library gives you every choice.

If you copy-paste your sketch or attach your INO file, we would have some idea of what you are doing.
If your sketch folder has separate files for the PROGMEM bitmaps, you should ZIP up the folder and attach it.

David.

Haha, i’ll take note of that :slight_smile:

And, those are not normal bitmap. i mean, they’re not .bmp files

i was wrong, because the name of the function used is “drawBitmap”, but it’s just something like that: “const unsigned char myBitmap PROGMEM = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,};”

the .ino file is my project file, i can’t paste it here because my message would be too long (over 9000 characters)

DSC_0024.jpg is a picture i took of the screen without the PROGMEM flag (reminds me of MissingNo from pokemon ^^)

and DSC_0028.jpg is a picture of the project with the PROGMEM flag (the picture is weird, but i only wanted a simple test picture, so i started up paint and made a simple test picture, exported it in 1bit .bmp and converted it using this online tool: image2cpp)

bitmap_anim_test.ino (8.47 KB)