Тёмный

How to Rotate Sprites (TFT_ESPI library) PROGRAMING TUTORIAL 

Volos Projects
Подписаться 95 тыс.
Просмотров 33 тыс.
50% 1

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,

Наука

Опубликовано:

 

9 янв 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 107   
@BlondieSL
@BlondieSL Год назад
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!!!
@lobster123
@lobster123 Год назад
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.
@tonyparakka4038
@tonyparakka4038 6 месяцев назад
Thank you! Love your step-by-step build up of the full code! Really helps understanding how to go about it!
@AksamDar
@AksamDar Год назад
Great video. Very precise and very clear. Hope you keep on doing such tutorials regularly.
@phaZed9
@phaZed9 Год назад
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
@VolosProjects Год назад
Thank you Aaron. Your comment is great motivation. Thank you.
@amimandlReal
@amimandlReal Год назад
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
@VolosProjects Год назад
Thank you, comments like this makes me happy. Thank you for coffee also.
@chipko
@chipko Год назад
I just bought a few more boards because you inspire me to make things! Another great video!
@VolosProjects
@VolosProjects Год назад
haha, never enougth boards.
@TekGeekDad
@TekGeekDad Год назад
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.
@greglogan4443
@greglogan4443 Год назад
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
@VolosProjects Год назад
Thank you :)
@bitmaker_
@bitmaker_ Год назад
Another super useful project! I used this on my previous YT project. Thanks for this content!
@jimbooth2010
@jimbooth2010 Год назад
Great video.. really appreciate how you build code in steps which reveals the problems and how to fix it. Thanks!!
@paul.newland
@paul.newland 4 месяца назад
Your sprite tutorials are absolutely brilliant!
@VolosProjects
@VolosProjects 4 месяца назад
Thank you, and thank you for coffee
@rocoroco15
@rocoroco15 Год назад
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!
@adamschofield2960
@adamschofield2960 Месяц назад
Excellent...your training ability is superb. THANKS.
@danielsnyder6900
@danielsnyder6900 3 месяца назад
Great tutorial! Reading the API is one thing but sample code makes it clearer, thanks
@krusethorsten
@krusethorsten Год назад
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
@VolosProjects Год назад
Tnx, I am glad you finded your solution.
@phakalanep7241
@phakalanep7241 Год назад
Thanks for this can not wait to try this out
@ytfp
@ytfp Год назад
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
@VolosProjects Год назад
Thank you, i hope the will :)
@akelarsson3358
@akelarsson3358 11 месяцев назад
Excellent, not too hard to follow but very educational for me - thanks!
@egealkoyak1530
@egealkoyak1530 Год назад
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!
@2001pulsar
@2001pulsar Год назад
Thanks for your guidance. Love the content.
@VolosProjects
@VolosProjects Год назад
Thank you for coffees.
@raspberrypibuenosaires
@raspberrypibuenosaires Год назад
Great video, easy to follow and learn in the way
@jasongreenwood3260
@jasongreenwood3260 Год назад
I learned a lot! Thank you!
@zyghom
@zyghom Год назад
amazing job! thank you
@leehewitt9559
@leehewitt9559 Год назад
Fantastic again my friend.
@Jackie-sg8es
@Jackie-sg8es Год назад
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.
@gazzacroy
@gazzacroy 7 месяцев назад
brilliant video. very interesting :)
@jeffreymorris1752
@jeffreymorris1752 Год назад
Very useful. Thank you.
@gitgudchannel
@gitgudchannel Год назад
svaka čast legendo
@BlaineL
@BlaineL Год назад
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
@VolosProjects Год назад
Thank you Blaine, on esp32 any pins can be scl or sda, all pins can be used as interupts. Tnx for coffee 😀
@BlaineL
@BlaineL Год назад
@@VolosProjects Oh ! Wow. Fantastic. No wonder I couldn't find anything... LOL Thanks again!
@rene-jeanmercier6517
@rene-jeanmercier6517 Год назад
This is great ! Thank you for sharing your knowledge. Regards, RJM
@VolosProjects
@VolosProjects Год назад
Thank you Rene, i am happye you found something useful for yourself.
@TYGAMatt
@TYGAMatt Год назад
Super helpful
@TheSolderingGuy007
@TheSolderingGuy007 6 месяцев назад
Awesome. Subscribing 🙂
@Edmorbus
@Edmorbus Год назад
Thanks for sharing
@luisrey8986
@luisrey8986 Год назад
Excelente! 😃👍
@sltechgalaxy1677
@sltechgalaxy1677 Год назад
thanks for this video
@maikelmolto8986
@maikelmolto8986 5 месяцев назад
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.
@scome98
@scome98 11 месяцев назад
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?
@NielsNL68
@NielsNL68 Год назад
thanks for this tutorial, i was wondering could you move lines 19 to 24 of the last shots to the setup() section?
@jfseaman1
@jfseaman1 Год назад
Thank you.
@masoudsh5133
@masoudsh5133 Год назад
very excellent I wish you could explain the rest of the steps
@dans-designs
@dans-designs Год назад
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??
@ATS3788
@ATS3788 10 месяцев назад
wonderful project. grüße aus Deutschland
@edivollgas719
@edivollgas719 Год назад
great job example on t-rgb round display would be perfectly helpfull.......
@yanhuang4911
@yanhuang4911 Год назад
great tutorial, thank you! a question: how do I push rotated sprite to a specified location? something like pushRotated(x, y, angle, &background)
@purgiaali
@purgiaali Год назад
The tft library has some dark colour defined as TFT_TRANSPARENT. You could use that if you need black in your sprite.
@user-mw8yv7pq7v
@user-mw8yv7pq7v 2 месяца назад
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.
@RatthaninWartcheeranon
@RatthaninWartcheeranon Год назад
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.)
@Windorey
@Windorey Год назад
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
@teocerda5367
@teocerda5367 Год назад
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.
@arturpoldan8816
@arturpoldan8816 Год назад
Nice tutorial. Could you put all the sprite drawing in setup and leave only push in the loop?
@WagonLoads
@WagonLoads Год назад
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?
@lukaspetrikas6320
@lukaspetrikas6320 Год назад
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
@VolosProjects Год назад
Sorry, only arduino
@RonAdamsky
@RonAdamsky Год назад
Please project ESP S3 Internet radio with new display. Thanks for your all interesting things.
@terjeoseberg990
@terjeoseberg990 Год назад
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?
@Intesanoga
@Intesanoga Год назад
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
@VolosProjects Год назад
Thank you, i wish that there is simulator but for now i think there is no such a software. Tnx again.
@No1sonuk
@No1sonuk 6 месяцев назад
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.
@guythegeek
@guythegeek Год назад
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.
@Attic-Toy-Design
@Attic-Toy-Design Год назад
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!
@fatihcemalcan3280
@fatihcemalcan3280 10 месяцев назад
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.
@martyngriffin5943
@martyngriffin5943 Год назад
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?
@BlondieSL
@BlondieSL Год назад
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
@VolosProjects Год назад
No, they dont, they need aditional sensor for that
@srfrg9707
@srfrg9707 Год назад
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
@VolosProjects Год назад
I dont know what is version of library, you need to use modified version of library lilygo provided ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gpyeMjM9cOU.html
@srfrg9707
@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.
@bengtkarlsson9747
@bengtkarlsson9747 6 месяцев назад
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.
@almazcarpets
@almazcarpets Год назад
Any project on vedio transmission and reception via Lora modules
@rickharms1
@rickharms1 2 дня назад
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.
@rodrigca22
@rodrigca22 11 месяцев назад
I noticed you pushed the sprite to a position, then removed the positioning command. How do you redefine the position of the sprite?
@gringocallo1002
@gringocallo1002 Год назад
sir good day, sir can you make a stopwatch with wireless stop/start button with this lilygo t-display s3
@jeffreymartinez1848
@jeffreymartinez1848 Год назад
Hey Volos, I just found your chanel and need some guidance with a project game I'm working on
@VolosProjects
@VolosProjects Год назад
Hello, how can i help you?
@jeffreymartinez1848
@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
@ipadize
@ipadize Год назад
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
@VolosProjects Год назад
tft.drawString(String(number)+" ",0,0,2);
@ipadize
@ipadize Год назад
@@VolosProjects thank you, i will try this 😊
@ipadize
@ipadize Год назад
@@VolosProjects yep worked :)
@JonMcPhalen
@JonMcPhalen 2 месяца назад
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
@VolosProjects 2 месяца назад
Hm, thease are two diferent boards, this tutorial will not work for m5stick.
@VolosProjects
@VolosProjects 2 месяца назад
What versiom of m5stuck cpkus you have, old or new? M5stick have diferent sprite aproach
@JonMcPhalen
@JonMcPhalen 2 месяца назад
@@VolosProjects The version giving me fits is the Plus2. I have the regular Plus (1.1) as well.
@minglv
@minglv 5 месяцев назад
Write the code according to the video, but the screen does not display. Not sure what the problem is?😅
@svencz1089
@svencz1089 Год назад
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
@VolosProjects Год назад
You used sprite.setPivot or tft.setPivot
@svencz1089
@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
@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
@svencz1089 Год назад
@@VolosProjects ok thx.
@Elad6k
@Elad6k Год назад
Cool video, as always, look at your email, I sent you a cool future project with the T-display
@VolosProjects
@VolosProjects Год назад
sorry, i will check it right now
@oldNavyJZ
@oldNavyJZ Год назад
I ordered one from them but it came dead. Solid green LED and a solid red LED. Sometimes won't even power on.
@BlondieSL
@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
@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.
@mikemorrow4949
@mikemorrow4949 Год назад
You really need to edit for time. This is really boring watching code upload over and over.
Далее
КТО ЭТО БЫЛ?
25:31
Просмотров 1,1 млн
Customize Your ESP32 LCD with Any Font Imaginable
14:49
Bar Graph - Programming Tutorial (TFT_eSPI library)
36:25
Getting Started with Meshtastic - Devices
15:01
Просмотров 190 тыс.
How to Scroll Image (ESP32 and TFT display)
8:00
Просмотров 29 тыс.
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Просмотров 47 тыс.
S-Pen в Samsung достоин Золота #Shorts
0:38