Great instructional videos! I remember using sprites in 1983 (40 years ago!) on a Commodore 64. Those were 24×21 pixels and if your sprite resembled anything beyond a blocky blob then you were having a very good day.
thank you so much for making video's with this esp board. I picked it for a school project with basicly 0 programming experience, and then i could find almost zero information on how to program it. Your videos saved my project!
Fast to draw front arc and erase rear arc to move circle from an edge.(But beware of undrawn pixels for thin line). Also should always pause after changes to permit persistance of human vision to load the new image to brain. In ideal world, 20ms for recalculations and delay to give 50 frames per second. Ah... I am watching as typing. So I'm theorising that the operations are made to fast ESP32 RAM instead of TFT and then DMA load from RAM to TFT with your img.push operation. Thanks for tutorial!
I haven't started watching, but already am super happy you made this one... i've been trying to understand what a sprite is/does and how to use it to make a little game... but i was still confused a lot! BTW, i normally dont comment on YT, but i just want to say i love your video's, i bought a couple of these ESP32's with a build-in screen for a little project and learned so much from your video's!!!
Nice job... I was trying to put lots of code on my Lilygo T-watch (with your graphs and others that I like) and now I'm understanding a little better how do it
not sure when i subscribed but every time i hear you say subscribe i look, this time i'll say thanks for putting so much information out! these display manufacturers should send you free screens every time and pay you!!
It would be great if you could explain the theory and why it's smoother and better than the other approach. I want to know the behind the scenes implementation process.
@@mashurshalehin4972 Not necessarily. There are several ways to do it. The approach you suggest would be called "double frame buffer", where you one complete frame ready to go as soon as the display refreshes and you have another frame which the CPU id drawing into. When you complete your drawing, the frames are swapped (usually just by readdressing the memory which is actually read by the display. So no memory moves or is copied, it's just the screen render is pointed to a different frame. The flicker is caused by the software writing into the frame that is currently on screen, so you see a series of partial images as one partial frames get drawn on each screen before it switches. The other way with single buffer, you just wait for the refresh and write the buffer as fast as the screen draws. The better way to have this implemented would be to have a parameter to UpdateDisplay() which is True/False and denotes if the display should wait on the refresh or render immediately.
Hey, firstly, thanks for a great video, I'm learning a lot about Arduino/ESP32 at the moment and this has been really informative. Secondly would you mind sharing the sketch for the fuel gauge shown at 20secs? I want to make a speedo gauge and the asthetic of yours is exactly what I'm hoping to achieve. Thanks again!
was commodore user and did use sprite concept alot. my explanation version to newbie. you are drawing graphic to memory (not to screen), after you done draw graphic (into memory), copy the memory to screen., done, rinse and repeat. to some (and on old computers) yes, this slightly slow graphics viewing-play. but the slowness is offset by the speed of cpu processing the code, modern computer makes it useless because the cpu is far faster and flicker comes back. interesting is unfazed by small development boards.
Interesantno. Razlika je, da se operacie kod sprite rade u memoriji a ne na ekran, tek na kraju se sprite odlikuje na ekran. Sto ukupno ispadne brze i kao neka vrsta doublebuffera. Mozda bi mogao jos i da uklonis ove dve operatie sa "TFT_BLACK" i da koristis "fillSprite(TFT_BLACK)" na pocetku. Po specifikaciju bi moglo biti jos malo brze :)
Those screen flickers look like image buffer corruption to me. I guess it's because of unaligned memory writes or LCD's driver issue, maybe it has to do with the weird resolution this display has, and I'd say you're essentially bypassing the issue with writing full frame buffer every frame which is less efficient both in terms of CPU cycles and memory usage than the partial screen update the first approach had. I'm interested to figure the real issue out.
Why am I getting this error when I trying to do something with this ttgo? Sketch uses 18280 bytes (59%) of program storage space. Maximum is 30720 bytes. Global variables use 1882 bytes (91%) of dynamic memory, leaving 166 bytes for local variables. Maximum is 2048 byt
Thank you.. I need your help if possible.. Im using this TFT_eSPI library with my st7735 128x128 display.. and it works great when I show a 16-bit image using pushImage( ) function. but if I print a text on top of it, the text starts flickering. I've tried many things to no avail, but if I change the image to the 8-bit bitmaps it works perfectly ! .. so can I display an 8-bit color image (not bitmap) using this library ?
Just to confirm, this doesn't have to be on a TTGO, right? It can be any ESP32 board, like ESP32 WROOOM ? And will any TFT work, like the 4 wire ones, or does it require TFTs that have several wires?
@@VolosProjects I tried to confirm if what I found was right, but as expected, even without posting an actual like, the algorithm removed my comment. I hate the YT algo! It really is horrible. It lets seriously bad comments to remain, then removes normal comments. So again, let me try. Is what I'm looking for have the title at the top, left corner of Bodmer T'F'T'_'e'S'P'I' (I add ' to confuse the algo) ?? (LET'S SEE IF THIS COMMENT STICKS... SIGH)
Hi and thanks for great videos, I am finding them very useful. I am working with ESP32-Vroom and 320*240 TFT(SPI), when I define my sprite with full length it does not work (LCD is black) but when I break it into 2 sprit of 120*320 I have no issue and it successfully updates the LCD? Any ideas?
Well, you have just answered my question of if an ESP32-WROOM and pretty much any TFT will work. Thanks for that. As for what you mentioned, have you tried messing with the X/Y screen size numbers? Like, perhaps reduce x and y by 1 number and use 1 to 320 (or 1 to 319) instead of 0? I know that with Arduino and TFT screens, I ran into issue of the screen not working right when being too "exact" with the numbers. I tested by reducing the numbers by 1 (I think it was) and then things would work. just an idea.
Great video. I followed along using ESP32 and ILI9341 (240x320) and it worked great until I tried to make the full-screen 240x320 sprite (scaled up from your example). It will only go so big before it stops working. I'm guessing it's a memory issue and I need som more teaching. I can't seem to find another tutorial that goes deeper :(
Interesting idea. But why don't you use "real" sprites? A circle sprite you just move over the screen? And a number sprite which you update every loop?
As a TFT_eSPI newbie, this confused me a bit too at first. I expected the circle to be the sprite rather than the screen (or the portion of the screen) that contains the circle.
@@VolosProjects it's because i tried using deleteSprite to clear my screen but it doesn't seem to work, can you please tell me how to use it properly or point me to a tutorial that uses the function
No, usualy in my videos code is free. But this is tutorial , just fallow along and write code i wroted in tutorial, you will learn easier than just copy and past code. I dont have this code anymore.
@@VolosProjects Ah yes, perfectly fair! I looked and couldn't find it, but now I understand. Thanks for the feedback... Do you have a tutorial that teaches how to overlay a numeric counter over a background image? I'm trying to use the information from several videos on your channel, but without success.... Thank you very much for your answer, big hug.
Okay. I'm going to try to explain the problem I'm having with your example. I have a different size display. Mine is 240x240 (size set in the user_settup.h file). Your code line by line works great but if I change the size of the sprite to 240x240 it won't run. All I get is a black screen. I've change the size of it on both x and y and the only time I can get it to run is if the size of the sprite difference between x and y is >= 10. img.createSprite(240, 240); doesn't work. img.createSprite(235, 235); works img.createSprite(240, 231); doesn't work img.createSprite(240, 230); works img.createSprite(230, 240); works img.createSprite(231, 240); doesn't work img.createSprite(239, 231); works img.createSprite(235, 235); works. I'm confused. Could this be something in the user_setup.h? Edit: I found my answer. This may help others. I’m using an ESP32 Wroom 32. “A Sprite is notionally an invisible graphics screen that is kept in the processors RAM. Graphics can be drawn into the Sprite just as they can be drawn directly to the screen. Once the Sprite is completed it can be plotted onto the screen in any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. Sprites by default use 16 bit colours, the bit depth can be set to 8 bits (256 colours) , or 1 bit (any 2 colours) to reduce the RAM needed. On an ESP8266 the largest 16 bit colour Sprite that can be created is about 160x128 pixels, this consumes 40Kbytes of RAM. On an ESP32 the workspace RAM is more limited than the datasheet implies so a 16 bit colour Sprite is limited to about 200x200 pixels (~80Kbytes), an 8 bit sprite to 320x240 pixels (~76kbytes). A 1 bit per pixel Sprite requires only 9600 bytes for a full 320 x 240 screen buffer, this is ideal for supporting use with 2 colour bitmap fonts.” github.com/Bodmer/TFT_eSPI#sprites
@@VolosProjects Any chance that you could post that specific link to the latest? I loved your video. That's how to get a point across. Show first what doesn't work well, then insert what does. This made understanding sprites so easy. Oh, to confirm as above, this should work with any ESP32 board, i.e. ESP32 WROOM and any TFT display? Thanks in advance.
This is the first video of yours I have seen. For me as a beginner, the way you have gone through this is fantastic! Thank you so much.
Thank you Christopher, i am glad I helped.
@@VolosProjects Thank you so much for your videos! Just bought you a dozen coffees. Don't drink all at once! :) Thanks again.
yes me also
Great instructional videos! I remember using sprites in 1983 (40 years ago!) on a Commodore 64. Those were 24×21 pixels and if your sprite resembled anything beyond a blocky blob then you were having a very good day.
I really like the way you structure this video, because it reflects the ways a normal beginner will start over and you shot hot to be a pro
Haven’t played with sprites since the days of Commodore 64 (showing my age 😄). Wish I understood them then like I do now. Many thanks! 👍🏾🤓
🤓🤟
Dude, That's quite huge collection of displays for a single person.
Thanks
thank you so much for making video's with this esp board. I picked it for a school project with basicly 0 programming experience, and then i could find almost zero information on how to program it. Your videos saved my project!
Nice to hear that :) Thank you!
Fast to draw front arc and erase rear arc to move circle from an edge.(But beware of undrawn pixels for thin line). Also should always pause after changes to permit persistance of human vision to load the new image to brain. In ideal world, 20ms for recalculations and delay to give 50 frames per second. Ah... I am watching as typing. So I'm theorising that the operations are made to fast ESP32 RAM instead of TFT and then DMA load from RAM to TFT with your img.push operation. Thanks for tutorial!
I haven't started watching, but already am super happy you made this one... i've been trying to understand what a sprite is/does and how to use it to make a little game... but i was still confused a lot! BTW, i normally dont comment on YT, but i just want to say i love your video's, i bought a couple of these ESP32's with a build-in screen for a little project and learned so much from your video's!!!
Thank you for your support, i hope this tutorial will help you.
Thank you for the explanations of how this works, quality information on how to program for the LCD is excellent.
thank you!
Nice job... I was trying to put lots of code on my Lilygo T-watch (with your graphs and others that I like) and now I'm understanding a little better how do it
i like how you just chill in your garden and make great content for us :)
Simple, practical and even had birds chirping!
not sure when i subscribed but every time i hear you say subscribe i look, this time i'll say thanks for putting so much information out! these display manufacturers should send you free screens every time and pay you!!
I am glad you did.Thank you😀
So basically drawing to an offscreen buffer, then drawing all in one blit, its goood
It would be great if you could explain the theory and why it's smoother and better than the other approach. I want to know the behind the scenes implementation process.
The sprite library waits and draws with the refresh. Basically "vSync"
@@1over137 Is it like this, it saves the whole frame in memory and refreshes the whole frame with one shot?
@@mashurshalehin4972 Not necessarily. There are several ways to do it. The approach you suggest would be called "double frame buffer", where you one complete frame ready to go as soon as the display refreshes and you have another frame which the CPU id drawing into.
When you complete your drawing, the frames are swapped (usually just by readdressing the memory which is actually read by the display. So no memory moves or is copied, it's just the screen render is pointed to a different frame.
The flicker is caused by the software writing into the frame that is currently on screen, so you see a series of partial images as one partial frames get drawn on each screen before it switches.
The other way with single buffer, you just wait for the refresh and write the buffer as fast as the screen draws.
The better way to have this implemented would be to have a parameter to UpdateDisplay() which is True/False and denotes if the display should wait on the refresh or render immediately.
I'M IN LOVE WITH THE SPRITES NOW :)
Very helpful. Seems like learning to use Sprite's is critical to developing great projects. this is a Great video to show why.. Thanks jimS
Interesting. Never dis anything with sprites. I’ll try to use them. Thanks one more time. 🤘🏽🤘🏽🤘🏽.
Once again an interesting and incredibly useful video. Thank you so much!
Tnx chipko
Danke dir Volo für die Mühe die du dir gemacht hast - ich konnte viel lernen, zumal mir jetzt vieles klar geworden ist.
Hey, firstly, thanks for a great video, I'm learning a lot about Arduino/ESP32 at the moment and this has been really informative. Secondly would you mind sharing the sketch for the fuel gauge shown at 20secs? I want to make a speedo gauge and the asthetic of yours is exactly what I'm hoping to achieve. Thanks again!
Very useful, looking forward to next sprites tutorials!
Nice Pizza oven! Good tutorial.
Excellent! That was a very good demo of using sprites
Tnx Nick
Nice example! Looking forward for more with sprites..
Thank you very much ... I did learn something new!!!
Thank you 😀
Please do a tutorial / video on how to design a pcb board from a simple circuit using software.
Absolutely clear explanation thanks
Thank you Volos! I have learned a lot from this video. You explain it in a very clear and funny way. Congratulations!!
Thank you, i hope this will be usefull for you. Cheers from Croatia
WOW, that was easy... Thanks for sharing, it is very much appreciated here.
was commodore user and did use sprite concept alot. my explanation version to newbie. you are drawing graphic to memory (not to screen), after you done draw graphic (into memory), copy the memory to screen., done, rinse and repeat.
to some (and on old computers) yes, this slightly slow graphics viewing-play. but the slowness is offset by the speed of cpu processing the code, modern computer makes it useless because the cpu is far faster and flicker comes back. interesting is unfazed by small development boards.
Subscribed Instantly!
Thank you very much for your tutorials,...How do you speed up Sprites? It seems to be very slow as compared to non-Sprites.
6:21 that's actually a useful bug!
Thanks for another great video!
Thank you! Coffee coming your way!
thank you Mark!
Interesantno. Razlika je, da se operacie kod sprite rade u memoriji a ne na ekran, tek na kraju se sprite odlikuje na ekran. Sto ukupno ispadne brze i kao neka vrsta doublebuffera. Mozda bi mogao jos i da uklonis ove dve operatie sa "TFT_BLACK" i da koristis "fillSprite(TFT_BLACK)" na pocetku. Po specifikaciju bi moglo biti jos malo brze :)
perfect! I spent so much time on looking for such thingis ;-)
Those screen flickers look like image buffer corruption to me. I guess it's because of unaligned memory writes or LCD's driver issue, maybe it has to do with the weird resolution this display has, and I'd say you're essentially bypassing the issue with writing full frame buffer every frame which is less efficient both in terms of CPU cycles and memory usage than the partial screen update the first approach had. I'm interested to figure the real issue out.
I use the same display and i use a typical esp32 and i am not using any sprite but it works completely fine but i am happy to learn sprite 🐱
Great info.
Sprite is like a backbufferr I think
Liked, favorited, subscribed and appreciated!
How do you know which displays are supported? I've a few ST7735 TFT displays, flickers a lot and low resolution
Great tutorial, very informative.
Very Good
You rock dude, thanks 👍🏼
Cool!!! thanks l use ttgo t4
Very cool, TY for sharing.
good job. the orange ball looks nice, is it OK to use a circle image instead of the ball?
When ever I hear the word 'Sprite' I think of Mr Claypole in Rentaghost.
Please, I need more on this topic
great sir..very useful
Thank you! That helped a lot understanding (:
Thank you Jan ,for comment and for coffee😀
Nice 👍🏻
..brilliant video, you’re a great teacher, thank you!!
..are you looking forward to TTGO t-Display Amoled, should be cool
OMG where did you get that coffee mug?
Hey hey Bro! Thanks too much for the tutorial.!
Tnx , nice user name :)
Great video. Thanks
"Takes a drink of sprite while watching a video that is talking about sprites"
Why am I getting this error when I trying to do something with this ttgo?
Sketch uses 18280 bytes (59%) of program storage space. Maximum is 30720 bytes.
Global variables use 1882 bytes (91%) of dynamic memory, leaving 166 bytes for local variables. Maximum is 2048 byt
Where is part 2??? I haven't been able to figure out how to make a masked sprite, I was hoping you had information on that.
Thank you..
I need your help if possible..
Im using this TFT_eSPI library with my st7735 128x128 display.. and it works great when I show a 16-bit image using pushImage( ) function.
but if I print a text on top of it, the text starts flickering.
I've tried many things to no avail, but if I change the image to the 8-bit bitmaps it works perfectly ! ..
so can I display an 8-bit color image (not bitmap) using this library ?
Just to confirm, this doesn't have to be on a TTGO, right?
It can be any ESP32 board, like ESP32 WROOOM ?
And will any TFT work, like the 4 wire ones, or does it require TFTs that have several wires?
This will work on any board that is sušprted by boodmers tft_espi library..
@@VolosProjects I tried to confirm if what I found was right, but as expected, even without posting an actual like, the algorithm removed my comment.
I hate the YT algo! It really is horrible. It lets seriously bad comments to remain, then removes normal comments.
So again, let me try.
Is what I'm looking for have the title at the top, left corner of
Bodmer T'F'T'_'e'S'P'I'
(I add ' to confuse the algo)
??
(LET'S SEE IF THIS COMMENT STICKS... SIGH)
Can you do a tutorial on using Lvgl library with T-Display S3 make of nice UI, fonts, colors, etc.
Thank you !!!
here we go!!!! 😊😮😊😊
Hi and thanks for great videos, I am finding them very useful. I am working with ESP32-Vroom and 320*240 TFT(SPI), when I define my sprite with full length it does not work (LCD is black) but when I break it into 2 sprit of 120*320 I have no issue and it successfully updates the LCD? Any ideas?
Well, you have just answered my question of if an ESP32-WROOM and pretty much any TFT will work.
Thanks for that.
As for what you mentioned, have you tried messing with the X/Y screen size numbers?
Like, perhaps reduce x and y by 1 number and use 1 to 320 (or 1 to 319) instead of 0?
I know that with Arduino and TFT screens, I ran into issue of the screen not working right when being too "exact" with the numbers.
I tested by reducing the numbers by 1 (I think it was) and then things would work.
just an idea.
Thanks!
Thanks for this clear explanation! I have learned a lot!
nice to hear that. thank you
and willing nice tutoet League teams and players to chose as their editor. More money for tho. It is pretty cool to see the progress I
Nice !...cheers.
So, Sprite will paint the objects into the memory one by one and then into the screen in one shot?
Yes, you are right
благодарю бро за такое пошаговое объяснение. Можешь рассказать так же про режим DMA на ESP32?
What User Setup do you use in "User_Setup_Select.h"?
setup 200, but you need setup pins
Great video. I followed along using ESP32 and ILI9341 (240x320) and it worked great until I tried to make the full-screen 240x320 sprite (scaled up from your example). It will only go so big before it stops working. I'm guessing it's a memory issue and I need som more teaching. I can't seem to find another tutorial that goes deeper :(
Me too! I found the solution - add the line img.setColorDepth(8); to the loop function. It reduces the memory needed and the sprite works well now.
@@solarprojectuk thank you!
Good stuff!! But as far as I can understand, ONE sprite of 135x200 pixels takes all RAM memory of ESP32 :(
Hy! is possible to develop an menu user interface with sprites?
Interesting idea. But why don't you use "real" sprites? A circle sprite you just move over the screen? And a number sprite which you update every loop?
i dont understand, what is real sprite?
As a TFT_eSPI newbie, this confused me a bit too at first. I expected the circle to be the sprite rather than the screen (or the portion of the screen) that contains the circle.
Can you please also tell me what is deleteSprite? What is its importance? How to use it?
Sprite can use lots of RAM memory, when you dont need sprite anymore you can delete it to free memory
@@VolosProjects it's because i tried using deleteSprite to clear my screen but it doesn't seem to work, can you please tell me how to use it properly or point me to a tutorial that uses the function
ahhaha thanks xD
Great example of "Arduino code". You just could use a Frame buffer to avoid ANY of this flickers :\
In this case, the sprite is the frame buffer. Or are you saying the display library has more direct support for frame buffers?
Do you only provide the code if they buy you a coffee?
No, usualy in my videos code is free. But this is tutorial , just fallow along and write code i wroted in tutorial, you will learn easier than just copy and past code. I dont have this code anymore.
@@VolosProjects Ah yes, perfectly fair!
I looked and couldn't find it, but now I understand. Thanks for the feedback...
Do you have a tutorial that teaches how to overlay a numeric counter over a background image?
I'm trying to use the information from several videos on your channel, but without success.... Thank you very much for your answer, big hug.
At time 00:05, we can see your pizza oven. Will you create a tutorial on how to build a pizza oven. Please.
Hello, sorry i dont know how to build it, my father build it. Where are you from, my wife surname is also Vukovic.
@@VolosProjects My father is from Kralievo, I was born in Cleveland.
I would love to go there some day.
Your screen flicker is pacman-esque.
Nice video thank you but could you repeat this video but using micropython please?
sorry, i dont like micropython and i dont know how to program esp32board using micropython
@@VolosProjects Never mind, I wouldn't have know if I hadn't asked.
I didn't find. Any sprite bottle😅
I think "why you need double buffering" would be a much more suitable title. whatever. i dont care much about strange arduino lib apis. cya
Okay. I'm going to try to explain the problem I'm having with your example.
I have a different size display. Mine is 240x240 (size set in the user_settup.h file). Your code line by line works great but if I change the size of the sprite to 240x240 it won't run. All I get is a black screen. I've change the size of it on both x and y and the only time I can get it to run is if the size of the sprite difference between x and y is >= 10.
img.createSprite(240, 240); doesn't work.
img.createSprite(235, 235); works
img.createSprite(240, 231); doesn't work
img.createSprite(240, 230); works
img.createSprite(230, 240); works
img.createSprite(231, 240); doesn't work
img.createSprite(239, 231); works
img.createSprite(235, 235); works.
I'm confused. Could this be something in the user_setup.h?
Edit: I found my answer. This may help others. I’m using an ESP32 Wroom 32.
“A Sprite is notionally an invisible graphics screen that is kept in the processors RAM. Graphics can be drawn into the Sprite just as they can be drawn directly to the screen. Once the Sprite is completed it can be plotted onto the screen in any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. Sprites by default use 16 bit colours, the bit depth can be set to 8 bits (256 colours) , or 1 bit (any 2 colours) to reduce the RAM needed. On an ESP8266 the largest 16 bit colour Sprite that can be created is about 160x128 pixels, this consumes 40Kbytes of RAM. On an ESP32 the workspace RAM is more limited than the datasheet implies so a 16 bit colour Sprite is limited to about 200x200 pixels (~80Kbytes), an 8 bit sprite to 320x240 pixels (~76kbytes). A 1 bit per pixel Sprite requires only 9600 bytes for a full 320 x 240 screen buffer, this is ideal for supporting use with 2 colour bitmap fonts.”
github.com/Bodmer/TFT_eSPI#sprites
Awesome. Thank you *1000. I'm using an ESP32 WROOM 32D and a 240*240 tft. Changing the sprite size to 240x235 worked for me.
You have older esp32 module which have less psram, so with sprite so big program crashes. You can try with diferent board
#include
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite img = TFT_eSprite(&tft);
void setup() {
tft.init();
tft.setRotation(1);
img.setColorDepth(true);
img.setColorDepth(1);
//img.setColorDepth(8);// NO IMAGE
img.fillSprite(TFT_RED);
img.createSprite(480,320);
}
int x = 0;
void loop() {
img.fillCircle(x,36,30,TFT_BLACK);
x = x + 10;
if (x > 480)
x = 0;
img.fillCircle(x,36,30,TFT_GREEN);
img.pushSprite(0, 0);
delay(10);
}
Not work on stm32f401ccu6
do you have latest, tft_espi library?
@@VolosProjects Any chance that you could post that specific link to the latest?
I loved your video. That's how to get a point across. Show first what doesn't work well, then insert what does.
This made understanding sprites so easy.
Oh, to confirm as above, this should work with any ESP32 board, i.e. ESP32 WROOM and any TFT display?
Thanks in advance.