Coding Games on an ILI9341 SPI LCD and Touchscreen - Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2021
  • Coding games on an SPI LCD and touchscreen needs a little bit of thought. Writing to the screen takes time so you need to minimise both the size and the update frequency of moving objects on the LCD panel.
    In this video I'll show you how to code a breakout (Arkanoid) game using the touch panel to control the player bat and the LCD for the screen display.
    You can easily get hold of one of these touchscreens at Amazon or eBay.
    Amazon: amzn.to/39ZyWMD
    eBay : ebay.us/sOCSyI
    Make sure you check out the project page on my website at
    bytesnbits.co.uk/arduino-brea...
    You'll be able to download the full source code for this project and get some extra info on how it's built.
    Don't forget to have a look at the full series of ILI9341 SPI LCD touchscreen videos.
    • ILI9341 SPI LCD touchs...

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

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

    I need to watch it twice or even more! but this is a great video and I'll learn a lot from it. thank you so much

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

      No problem. Have fun!

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

    Very nice, thanks for this 2 part tutorial.
    Just bought this display to get this running.
    Should be fun and I hope to master the 'Class' as it still confuses me a tad. 👌
    Liked & Subbed......

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

      Hi Michael. Great to hear you found it useful. Keep going with the object orientated programming. It's well worth the effort in mastering it!

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

      @@BytesNBits
      Well so far so good, at least my display works and have done all in this and the last video.
      I can now concentrate on your code to give me some pointers......Thanks again.

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

      @@michaelhawthorne8696 Great to hear it's going well. Let me know if you need any help.

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

    Epic video!

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

    Thank you very much this maks sense.

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

      Glad it was helpful!

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

    That's great video!
    Are ILI9341 Pins tolerant to 5 V?

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

      Thanks. No. They are 3.3V IO pins so please don't apply 5V to them. In the video I use resistors but have a look at level shifter ICs. They give a much neater package.

  • @larrybud
    @larrybud 6 หลายเดือนก่อน

    A "Breakout" type game was the first game I ever programmed, back on the Atari 800, all in 6502 assembly, probably around 1984-5... Wish I still had that source code.

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

      Boot up an emulator and give it another go!

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

    Cool

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

      Thanks.

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

    Hey Bob! Huge fan!
    I like to make games on the ILI9341 and esp32 dev module.
    I understand how busy you may be, but I was wondering if you wanted to program a game together?
    I've made Tetris, PacMan, 2-player pong(with potentiometer inputs) and more!
    I think we could create a really cool video series together, so I thought I'd reach out!

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

      Hi and thanks for the offer. With my proper job I struggle to make enough of my own videos so joint projects are not really on the cards at the moment. But it would be great to see what you're up to if you make some videos.

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

      @@BytesNBits Totally understood!
      I'm working up a mini series on game development, and object oriented programming within Arduino IDE and I'll happily share, you've been a huge part of my growth in the electronics field!

  • @granolakitti8521
    @granolakitti8521 11 หลายเดือนก่อน

    Is a framebuffer with 16 colors (4 bit) doable on the arduino?

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

      Memory space will always be an issue with the Arduino. 4bit colour = 2 pixels per byte. Even 100 x 100 pixels is 5KB. The Uno only has 2KB total RAM.

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

    What displays are compatible with the Arduino Giga R1? Are the same touch screens for Mega compatible with Giga? I keep looking, but I find limited info about connection and compatibility. I don't even see many videos showcasing the display connection possibilities! Specs talk about D1N, D0N, D1P, D0P, CKN, CKP + D68-D75. Can someone send me in the right direction?

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

      A lot of these displays use standard interfaces so there is no reason why electronically they won't be compatible. If you're buying these as a shield you'll need to check pin compatibility with the model you're using. If the two boards offer the same pin out they should be interchangeable.

    • @fench1234567
      @fench1234567 8 หลายเดือนก่อน +1

      @@BytesNBits I still know next to nothing about can bus, but I've been reading more about SPI, I2C, and serial connections the last few days. Also about the different bit sizes that the different arduinos support. (from 8-bit parallel and up) I'm looking to learn more before I buy ANYTHING. I got a couple of cheap TFT shlds for uno and mega 2560 that both work with examples. Definitely looking to learn more and get better stuff. I'll keep your advice in mind and go by pinouts befoire I buy. THANKS!

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

    hello workaround script emuparadise working but it is not working for dreamcast games there are two cdi and gdi without any script and if i press on them it is not responding can you help me ?

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

      Hi. The workaround script can't decipher the direct links if there are multiple downloads on a single page. It assumes the id number in the page url contains the id of the download which isn't true for these multiple pages. Sorry.

  • @mcnuggers5380
    @mcnuggers5380 3 หลายเดือนก่อน

    I use a different type of shield that is mounted directly on top of my Arduino board. And I'm not sure how to make the script work with my shield.

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

      You need to find out which pins the shield uses for each function. Also make sure you know what driver chip it uses as you'll need to match that in the code as well.

  • @user-ip1sn8ru5k
    @user-ip1sn8ru5k 8 หลายเดือนก่อน

    I have Problems with if(xCoord >= tftWidth) xCoord = tftWidth - 1;
    The arduino IDE doesn´t like ; after >
    Does anyone know what to change?

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

      My website has been messing up my code listings. If you see > delete it and use >, < should be = tftWidth) xCoord = tftWidth - 1;

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

    That Math.h library is wickedly hard to find... there is a "math h" but it's not working for your code.

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

      Hi. Thanks. I think I was going to use some trig functions but then decided against it. I think the reference to Math.h should have been taken out.

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

      @@BytesNBits , why?

  • @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.

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

      Hi Bob@@BytesNBits It's the two messages I left you on your website that have not been answered. I have tried to follow the whole series of this touch screen and not one script has compiled, it's not only the < and > which have been replaced with < and > its also all the & in the scripts, The script for the bouncing rectangles will never compile because the void setup is way down in the code, I compared the script in your video with the code you give us and in the video the void script starts just below the touch screen config settings, it's not just a case of cutting and pasting it where it should be as when I do what comes after it is different to in the video. Not one of your supplied scripts has compiled yet, that's pretty abysmal BOB if you are going to help people some care is needed to quality check your information, I am not good enough to correct your scripts. Also it would be useful to know which version of the files you used originaly as I have found with arduino often a script won't compile as someone changed something in one of the librarys. I have built a piece of test equipment and the script that came with it used a screen which looks identical to this, and in the script he uses URTOUCH.H well that won't work with my screen i guess the chip is different, and I am not good enough to fix it so I am trying to learn from you so I can re code his file to use XTP4026.h but I am pulling my hair out as I can't run any of your scripts.
      If you are blaming the website compiler why not post them as text files and we can copy and past and call it ino. Bob. UK