Basic animation in your SPI LCD touchscreen

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2020
  • Once you've got your LCD touchscreen working it opens up a vast array of possibilities to enhance your Arduino projects. You can create games, control panels, information displays or anything else that can use a screen output.
    The Adafruit GFX library contains a full set of graphics functions to let you develop your project.
    In this video I'll show you how to use the library and where to find out what functions it provides. But I'll also show you the limitations of these SPI screens in terms of speed for animations.
    To get animated objects on the screen you need to use an overdrawing method as the data transfer speed is too slow to clear the screen every frame. I'll cover this and then show you how to modify and optimise your code to get smooth animated displays.
    All the code used in this video is available on the project page in my website.
    bytesnbits.co.uk/basic-animat...
    You can easily get hold of one of these touchscreens at Amazon or eBay.
    Amazon: amzn.to/39ZyWMD
    eBay : ebay.us/sOCSyI
    Adafruit GFX Library Tutorial
    learn.adafruit.com/adafruit-g...

ความคิดเห็น • 45

  • @patrickk2791
    @patrickk2791 3 ปีที่แล้ว +2

    Once again a marvellous video, well explained. I learned a lot. Going from basic "Arduino" style coding to using C++ classes feels like coming out of the stone age! :) Your effort is very much appreciated!

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi Patrick. No problem. Moving to Object Orientated Programming makes complex coding so much easier by breaking up the problems into well defined blocks. Glad you found it useful.

  • @mikhailglukhov6680
    @mikhailglukhov6680 4 หลายเดือนก่อน +1

    Absolutely awesome tutorial that deserves much more views. Thank you!

    • @BytesNBits
      @BytesNBits  4 หลายเดือนก่อน

      Glad you enjoyed it!

  • @freddycrespo4107
    @freddycrespo4107 ปีที่แล้ว

    Thanks Bytes N Bits. Perfect explanation !!

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      No problem. I hope it was useful.

  • @majorutah2867
    @majorutah2867 8 หลายเดือนก่อน

    That blew my mind, thank you sir

    • @BytesNBits
      @BytesNBits  8 หลายเดือนก่อน

      Glad you liked it!

  • @unai9634
    @unai9634 3 ปีที่แล้ว +1

    Man, you are AWESOME !!!!

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi Unai. Thanks.

  • @umutkayacan7659
    @umutkayacan7659 3 ปีที่แล้ว +1

    Good video. Keep up the good work

  • @ndrinks5550
    @ndrinks5550 2 หลายเดือนก่อน

    Excellent tutorial, and I was quite surprised to hear the N.Irish accent! Takes me back to the learning graphics on the old 386 and eventually moving to assembler to write directly to the VGA memory with all the clever smoke and mirrors type effects that could make it look like you were doing impossible things. 50hz of course being the correct refresh rate :-)

    • @BytesNBits
      @BytesNBits  2 หลายเดือนก่อน

      Thanks for the comments. Have fun with the coding.

  • @edwardhammock24
    @edwardhammock24 ปีที่แล้ว

    Brilliant vid! Thanks.
    Do you have an example of a chasing style graphic? I am programming a watering system and I want to have a mimic indicating the pump running and water flowing through the pipe. Thanks.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      Hi. Unfortunately this setup requires you to do the animations yourself. Even animated gifs, etc. need you to handle the frame changes in code. My advice would be to create a 2 frame animation of a short horizontal and vertical pipe (basically 2 image files per direction). Draw frame one in place, then a short time later draw frame 2 over the top of it. Place multiple short lengths together to make longer pipes. Maybe use a non animated corner piece.
      Good luck!

  • @jeffvenqueleir2036
    @jeffvenqueleir2036 2 ปีที่แล้ว

    Nice and use full

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      Great. I hope you got it working OK.

  • @bendertherobot910
    @bendertherobot910 3 ปีที่แล้ว

    Very, very interesting channel... I just bought 4 of these LCD and wanted to program them. This video will be very useful!! Thank you! One question: what's the maximum clock for SPI transfers referred to this kind of LCD? I want to drive these with a STM32F103 or a STM32F429.
    Indeed, an LCD with SPI is very useful with STM32 because they are not fast enough when using GPIO I/O...

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi. The data sheet timings suggest about 10MB/s data rate but I know people are running it at much, much higher. About 80MB/s gives you a 60Hz frame rate and some are getting this so I guess it's a matter of trying it out. I've just bought a new RPi Pico so plan some tests with that.
      Have fun and let me know how you get on.

    • @bendertherobot910
      @bendertherobot910 3 ปีที่แล้ว +1

      Thanks for the answer! I will try it in a few days...

  • @aronvasquez7667
    @aronvasquez7667 9 หลายเดือนก่อน

    Good video, can a query be used without a pencil?

    • @BytesNBits
      @BytesNBits  9 หลายเดือนก่อน

      Yes. Both resistive and capacitive screens will work with a finger. These resistive screens basically work with anything that presses on the touch panel.

  • @cyberspider78910
    @cyberspider78910 ปีที่แล้ว

    can you suggest proteus simulation for this project ??

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. Sorry, I don't use Proteus.

  • @4sfactor555
    @4sfactor555 ปีที่แล้ว +1

    Can you do with GIF images?? I wanna built a touchscreen DIGI PET with this

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      You'll need to either find a library that handles GIF format files or write your own. You need to be able to break it down to pixels. Have a look in the Adafruit graphics library. It may well handle GIF.

  • @atihrot755
    @atihrot755 ปีที่แล้ว

    Dear sir, how do I start drawing on the LCD display? I have all the libraries uploaded. Need to configure the screen? I have a 2.8 inch LCD. Please help. Well thank you.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. Is your LCD powered by the ILI9341 driver. If not you'll need to load the correct driver version that matches your screen. Most drivers are in the library package.

  • @Mike4_friends
    @Mike4_friends 3 ปีที่แล้ว

    SD card - did you get it to work with this display?

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +2

      Hi. I haven't had a play with the SD card yet. I'll be making another video soon using some images stored on the card. Keep an eye out for that one in a couple of weeks.

    • @diyk-h-m2423
      @diyk-h-m2423 3 ปีที่แล้ว

      @@BytesNBits yes sir please make soon i need to learn to be make my project

  • @PeetHobby
    @PeetHobby ปีที่แล้ว

    I just redraw the rectangle(or bmp, ect) in background colors, so it gets erased and then draw a new rectangle in the new position in normal colors again. That is faster than refreshing a whole bar.

  • @kalamabidin922
    @kalamabidin922 10 หลายเดือนก่อน

    Only showing white screen, nothing showing, how to solve this problem

    • @BytesNBits
      @BytesNBits  10 หลายเดือนก่อน

      Hi. I've replied on your other comment.

  • @jimdesposito9433
    @jimdesposito9433 10 หลายเดือนก่อน +1

    Hi Bob, great tutorial, very well made and a pleasure to follow along with. Just one comment, for anyone copy/pasting code from the website into Arduino IDE, change < to < and > to > and & to &.

    • @BytesNBits
      @BytesNBits  10 หลายเดือนก่อน

      Thanks for the info! My code highlighter on the website has messed up some of the older posts. I'll have to go through and update them.

    • @majorutah2867
      @majorutah2867 8 หลายเดือนก่อน

      What does that mean? I'm really trying to learn this stuff. Maybe I'll look it up Xy

  • @ijustwanttogosailing8248
    @ijustwanttogosailing8248 2 ปีที่แล้ว +1

    Intro is too loud :-//

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +2

      Hi. Sorry about that :)

  • @stoptheirlies
    @stoptheirlies 7 หลายเดือนก่อน

    Bob, I don't know what is going on but the files you have put on your website for us to download are nothing like what you show us here, this file on your site has the setup in the wrong place half way through the script and the script does not match what you show on here, Also some of your other script files have C++ code in them which will not run in the Arduino IDE, Pretty abysmal really and I am thinking you don't care as I have messaged you twice and you have not bothered to respond. Bob. UK

    • @BytesNBits
      @BytesNBits  7 หลายเดือนก่อน

      Sorry you're having problems. I've had a look at the code. It's all OK apart from the website code renderer has replaced the < symbols with the html code < and > with >. I think this is on the older code listings. Do a find and replace and the code should compile, though do have a look in case some other characters have been replaced.
      I assure you I do care. This is why I post these videos. I try to answer as many comments as I can.