How to Rotate Sprites (TFT_ESPI library) PROGRAMING TUTORIAL
Ғылым және технология
Hello, here is another programing tutorial.
In this video I will show you how to rotate sprites. I am using the t-display s3 development board but this concept will work with any display supported by tft:espi library. I hope this is not too hard to follow and I hope you will learn something. Enjoy!
You can check T-display S3 here: www.lilygo.cc/0cAg0r
here is tutorial about sprites: • How to use and why to ...
Here is compas code: github.com/VolosR/RotateCompas
Here is code from tutorial: github.com/VolosR/RotateSprit...
If you want to support my work you can buy me coffee/beer here:
ko-fi.com/volosprojects
Thank You! Dont forget to subscribe!
#esp32 , #tft_espi, #developmentboard, #arduino, #sprites,
Пікірлер: 109
Thanks for this can not wait to try this out
I just bought a few more boards because you inspire me to make things! Another great video!
@VolosProjects
Жыл бұрын
haha, never enougth boards.
Great video. Very precise and very clear. Hope you keep on doing such tutorials regularly.
I am just starting with esp32 programming on the S3 display, and your videos are super helpful. Hopefully you have more projects coming up, really looking forward.
Another super useful project! I used this on my previous YT project. Thanks for this content!
When I first heard of sprites on these ESP32s, I assumed that it would be so difficult. Then, I watch this video and learn that they are simple to create and manipulate. Thanks for all the work that you do to help the world learn. So amazing!!!
Thank you! Love your step-by-step build up of the full code! Really helps understanding how to go about it!
Nice and clear. Thanks for the great video and walk through of creating. I need to look more at the functions available in the sprite library.
I want to thank you for making these videos and explaining them so well ! Liked, Subscribed and bought you a coffee! Keep up the good work!
@VolosProjects
Жыл бұрын
Thank you, comments like this makes me happy. Thank you for coffee also.
Excellent...your training ability is superb. THANKS.
Great video.. really appreciate how you build code in steps which reveals the problems and how to fix it. Thanks!!
This is brilliant....thank you!! I've been struggling on a similar project with transparencies in sprites and your video showed me how to fix it. Thank you!!
@VolosProjects
Жыл бұрын
Thank you :)
Your sprite tutorials are absolutely brilliant!
@VolosProjects
4 ай бұрын
Thank you, and thank you for coffee
Just wanted to drop in and say, you are a great teacher and these tutorials are fantastic! I have a fairly decent history with 16 and 32 bit micros - and have created many projects. I've even used screens - but mostly pushing lines of text. Now I understand and know of the existence of these methods in the tft library.. thank you for that! Absolutely brilliant mate! This whole series has been outstanding. Subscribed.
@VolosProjects
Жыл бұрын
Thank you Aaron. Your comment is great motivation. Thank you.
Thank you again so much for your excellent lesson - I follow every move and are able to replicate your result - this is so satisfying! Can't wait for the next lesson!
Great tutorial and such talent, I hope many will leave you good feedback and comments for such a great video and sharing your work. Love this!
@VolosProjects
Жыл бұрын
Thank you, i hope the will :)
Great video, easy to follow and learn in the way
Excellent, not too hard to follow but very educational for me - thanks!
Great tutorial! Reading the API is one thing but sample code makes it clearer, thanks
I learned a lot! Thank you!
Thanks for your guidance. Love the content.
@VolosProjects
Жыл бұрын
Thank you for coffees.
amazing job! thank you
Fantastic again my friend.
Very useful. Thank you.
Here is the video I was looking for! Your videos really help me a lot for my projects. Is it possible that we can adjust the transparency of an image or pixel projected on the st7789? If possible, we would like to see how this is done in your video. Please keep posting videos!
svaka čast legendo
WOW, I tried this for my analog watch many times, only got stupid solutions, working, but bad coding. This video gave me all what I need to programm a analog watch I need. Thanks a lot!
@VolosProjects
Жыл бұрын
Tnx, I am glad you finded your solution.
brilliant video. very interesting :)
Super helpful
Thanks for sharing
thanks for this video
Good content as always. I am going to try and make an artificial horizon (EADI) with a MPU 6050 and rotating sprites as you’ve demonstrated. Many Thanks.
Excelente! 😃👍
Awesome. Subscribing 🙂
This is great ! Thank you for sharing your knowledge. Regards, RJM
@VolosProjects
Жыл бұрын
Thank you Rene, i am happye you found something useful for yourself.
Thank you.
wonderful project. grüße aus Deutschland
very excellent I wish you could explain the rest of the steps
great job example on t-rgb round display would be perfectly helpfull.......
thanks for this tutorial, i was wondering could you move lines 19 to 24 of the last shots to the setup() section?
Thank you so much for your videos. I'm excited to learn more about this T-S3 device! It's been so hard to find updated reliable information on it. I'd love to see how you can add an 8 or 16 bit IO Expander - if you're taking requests ;) I still haven't found out where the SCL/SDA pins are or even if there are any default interrupt pins I can use to pass back from the expander! Anyway - I'm off to buy you a coffee! Love your videos!
@VolosProjects
Жыл бұрын
Thank you Blaine, on esp32 any pins can be scl or sda, all pins can be used as interupts. Tnx for coffee 😀
@BlaineL
Жыл бұрын
@@VolosProjects Oh ! Wow. Fantastic. No wonder I couldn't find anything... LOL Thanks again!
I really appreciate this video - nicely done, very informative. Your approach is intuitive. However, now I am struggling to change the coordinates of the commands to adapt to a bigger TFT - and really got lost. A few extra words about the parameters along the line when you entered them would have made this vid a real burner.
love your tutorials! thank you so much!! do you know if it is possible to rotate a .bmp stored in SPIFFS - or is there a way to use a .bmp as a sprite??
The tft library has some dark colour defined as TFT_TRANSPARENT. You could use that if you need black in your sprite.
Excellent!! Thank you for doing these. very informative and I'm just starting to dabble with it. One question. How would you make a gradient gauge? Say for temperature going from Cold (blue) to normal (green) to hot (yellow and red) in a circle? Would you need to calculate the colors on the fly or maybe just doing a JPEG and using it as the background?
great tutorial, thank you! a question: how do I push rotated sprite to a specified location? something like pushRotated(x, y, angle, &background)
Hello sir. Great job. I enjoy your projects. Have you considered creating an artificial horizon project using spites? I'd like to create a working display on a 2 or 3 inch screen for my grandson who recently became a commercial pilot. I've struggled with the coding to create the display and pivot the background with roll and pitch. Thanks for your great tutorials.
Hello, do you have any plans on using the LVGL library? It offers great UI and even has an editor called SquareLine studio, it created the UI code automatically
Please project ESP S3 Internet radio with new display. Thanks for your all interesting things.
Hi thank you for your videos, do you have any ring gauge example? it's hard to find a good video or tutorial to build a ring gauge to measure speed or temperature.
good tutorial, simple understanding, I've got a question Can we put needle sprite fill and draw, also background circle in SETUP loop, and leave only angle increment and needle.pushRotate() in the main loop? (I haven't tried the code yet.)
Nice tutorial. Could you put all the sprite drawing in setup and leave only push in the loop?
I am trying to find the right pins used for i2c, but the ones I tried so far cause the serial port to give an error dump... Is there a special setting in the IDE drop-down menu to turn on i2c functionality?
This tutorial was very easy to follow, but you failed to explain why it would blink if you erased the sprite with tft.fillscreen(TFT_BLACK) rather than drawing another sprite as the background. Also, maybe you should have showed it blink. I assume there’s some sort of double buffering that’s going on, and all drawing happens on the hidden screen buffer. Then some command triggers a swap buffers after everything has been drawn. It would be nice if you explained this and told us which command is swapping the buffers. And if there is no double buffer, how is it avoiding blinking?
This is perfect, Im making a speed gauges with a moving needle on a round display and a GPS module for my and my friends mopeds. This will combined many of your tutorials that you have released lately. Does anybody know of a good esp32 and SPI screen emulator so I can test my code while Im waiting for the parts to arrive? Future plans for the display is also to show measured speed from hall-sensor and RPM from a capacitive sensor (wire) turned around the spark plug wire.
@VolosProjects
Жыл бұрын
Thank you, i wish that there is simulator but for now i think there is no such a software. Tnx again.
Hi! Is it possible to make a clock using .jpg image frames in a Lilygo T-Display S3? I have some nice .jpg numbers image frames and I'd like to use them to build a clock. Is one of your tutorials able to explain the process? If not, could you make a sample one to be downloaded from Github? I pay you a nice coffee! Thanks!
I find your videos very helpful. It would be very nice to see a video of you working with TFT displays on esp-idf platform. Do you code on esp-idf or only on Arduino?
@VolosProjects
Жыл бұрын
Sorry, only arduino
Kind of disappointed you didn't show the compass part. Also, is there a way to define 3 pivot points? I want to draw a 3-axis aircraft trim indicator.
Hi I have been using an SCD4X CO2/temp/humidity sensor from sensirion with a T-display-S3 displaying data in the form of three ring meters (TFT eSPI) everything works fine with my computer (USB connected) but when I use the t-display plugged to an usb adapteur the screen remains black. After investigation it looks like there is a ledc initialisation error. As the CO2 sensor is working only on I2C pins 43 and 44 I believe that we may have a conflict between I2C and the display. I am not very good in programming. The fact that it works with my computer and not pluged in a wall socket seems to be very strange. Any idea would be appreciated. Regards.
Before a sprite is pushed to the sreen, I would like to rotate it about 30 degrees before I draw the features onto it. How?
Is it possible to use both translate and rotate for sprites? I tried to use translate and rotate on a single sprite. However, i could not make. Thank you for your videos.
So, just curious... do these ESP32 boards (WROOM especially) have some sort of magnetic device on it that could be used to make a real compass?
@VolosProjects
Жыл бұрын
No, they dont, they need aditional sensor for that
Hi Volos. I have bought a TDisplay and I use Arduino V2. I can't manage to get any picture on the TFT screen (blank screen). I saw that there is an issue with some versions of TFT_eSPI by Bodmer. I found a old topic on the arduino forums with the same issue and it seems that one needed the version 2.4.71 to make the board word correctly. The current versions is 2.5.0. My issue is that the older versions available are 2.4.61 ; 2.4.72 and 2.4.79 Are you aware ot that issue and how do one resolve it?
@VolosProjects
Жыл бұрын
I dont know what is version of library, you need to use modified version of library lilygo provided kzread.info/dash/bejne/maStx6-jfZzJf7g.html
@srfrg9707
Жыл бұрын
@@VolosProjects Thanks. I found out my issue. It was not sofware related. It's a hardware failure. The screen goes black if I hold it by a specific area. I need to presson the screen to make the picture come back but it's very random. 😒 I have no luck with chinese products.
Any project on vedio transmission and reception via Lora modules
New with the M5Dial.. How would i modify this code to get it woking on M5Dial? I'm still confused - but on a higher level🙄Probably something obvious i guess.
I noticed you pushed the sprite to a position, then removed the positioning command. How do you redefine the position of the sprite?
The &(ampersand) is a C (C++) pointer to memory, I get that. However the line "back.pushSprite(0,0);" has me confused. I would have thought the coordinates would be more around the pivot. ?? Also, I am trying to find any documentation of all the TFT-SPI functions. The Bodmer github has some (kind'a) in the .h files, but appears not complete and confusing. For example, where did you learn about drawWedgeLine? I know you are smart, but you do not pull things out of ........ I will say thin air. Thank you.
can you show how to use drawString? I have a problem where i can manipulate a number with a encoder and increase it but when i decrease it then the last number is still visible on the screen, when it changes from for example 10 to 9. I would like to do something like drawString(number, 0, 0, 2) + (" ") but that obviously doesnt work.
@VolosProjects
Жыл бұрын
tft.drawString(String(number)+" ",0,0,2);
@ipadize
Жыл бұрын
@@VolosProjects thank you, i will try this 😊
@ipadize
Жыл бұрын
@@VolosProjects yep worked :)
Hey Volos, I just found your chanel and need some guidance with a project game I'm working on
@VolosProjects
Жыл бұрын
Hello, how can i help you?
@jeffreymartinez1848
Жыл бұрын
@@VolosProjects we are building a ttgo portable console and making a specific game that is will load. We believe you can be the lead programmer. I've sent you a coffee with my contact info on Kofi
sir good day, sir can you make a stopwatch with wireless stop/start button with this lilygo t-display s3
Cool video, as always, look at your email, I sent you a cool future project with the T-display
@VolosProjects
Жыл бұрын
sorry, i will check it right now
I tried following along using my M5StickC Plus-2 and the simple code bricked my device. It took a while to figure out how to unbrick it, but I bricked it again double-checking the code. I've got a T-Display-S3 on order. That said, I have a project that I want to use the M5StickC for (special IR control), so I'm hoping I can sort out what's happening.
@VolosProjects
2 ай бұрын
Hm, thease are two diferent boards, this tutorial will not work for m5stick.
@VolosProjects
2 ай бұрын
What versiom of m5stuck cpkus you have, old or new? M5stick have diferent sprite aproach
@JonMcPhalen
2 ай бұрын
@@VolosProjects The version giving me fits is the Plus2. I have the regular Plus (1.1) as well.
hi, I tried to rotate a second picture on a picture. That works, but I can't move the rotation point from the middle with "setPivot". it always revolves around the center of the display. only the point of the image around which it rotates changes.
@VolosProjects
Жыл бұрын
You used sprite.setPivot or tft.setPivot
@svencz1089
Жыл бұрын
@@VolosProjects tft.setPivot(45, 110); in Setup and in loop zeigerSprite.setPivot(22,110);. I have both in the program, pointerSprite.setPivot(22,110); changes the rotation point in the image but not the rotation point on the display. at tft.setPivot(45, 110); unfortunately nothing changes when the values are changed
@VolosProjects
Жыл бұрын
@@svencz1089 first, thank you for coffe, please, send me your whole code on arduino.b2016 gmail.com , tomoraow iw will check it and try to fix it
@svencz1089
Жыл бұрын
@@VolosProjects ok thx.
Write the code according to the video, but the screen does not display. Not sure what the problem is?😅
I ordered one from them but it came dead. Solid green LED and a solid red LED. Sometimes won't even power on.
@BlondieSL
Жыл бұрын
I wonder if it was preloaded with some bad code or something? When I bought my first 2 boards, one had a similar action. It would appear to power up, but just didn't act/react like the other board. It was like I couldn't upload even a LED blink test, because it would time out. It acted like I wasn't pushing the program button in at the right time. What I ended up doing to forcing the upload over and over and quickly pressing the button. I almost gave up, then finally, it clicked in and the code uploaded. After that, it worked fine, until one of my tests was caught in a very fast loop (my code error). When in that fast loop, it again acted up. So I again did the above force upload with pressing the prog button fast and eventually, it worked again. Since then, I just be careful to not create a fast loop (example, a while loop where it can never get out of it). No issues since. I don't know if that's the issue, but perhaps try that with a small, test LED blink test where you have some delay(1000); in loop. If you get lucky, that may get it working again. If nothing works, then it's probably a bad board and you'll need to contact the seller to get it replaced. That would also be a good test to see if the seller is honest or not. Personally, I NEVER EVER order anything directly from any seller in China. I've read of too many problems and rip offs. I only order stuff via Amazon and then, ONLY stuff that is "fulfilled" by Amazon. If any issues, Amazon has been excellent in pushing through a refund and either provide an RMA to send the thing back, or if it's not expensive, they tell me to just dispose of it. Good luck on that board.
@oldNavyJZ
Жыл бұрын
@@BlondieSL I actually tried this before reading your post and it finally worked with pretty much the same effort. I can now get compiled code on it. I think it just didn't have anything loaded - like they missed that step at the factory, or it was corrupt. In any case, it is working now. They need better tech writers.
Is there a Discord server that supports TFT_eSPI?
You really need to edit for time. This is really boring watching code upload over and over.