Hy Fellows,
I got myself a 320x240 pixel TFT, I want to create a game with it. It has a Ili9341 chip on it.
Now that I got it working, i made some little sketches. I use a "standard" library for it. There are commands like, drawPixel, or drawCircle. I made a little quick and dirty pong for example, but with the standard commands this is all to slow and flickering because for example the "clear" function draws every black pixel for each own, all 320x240. it is not the arduino, it is the way the grafics are drawn. I got the PDF for the display where all commands and registers are shown. There are some commands, where for example you can scroll the stuff in display memory then put it on display. But my experience level is to low for that. Does someone has some advice, for example there is the command: 33h, which you could send by sendCMD(0x33), in the manual it is called Vertical Scroll Definition, and there is a flow-chart for an Continous Scroll, but I don´t understand how to use it. I made a litte sketch, then moved the displayed stuff up ( with command 37h ) . But i am not doing it right, but I saw the effect, it was only moved in DisplayRam, really quick and didn´t need a clear-screen. That would be a speedup if I move everything down 1, then only draw one line instead of clearing and redraw everything seen.
Here is my sketch:
#include <stdint.h>
#include <TFTv2.h>
#include <SPI.h>
void setup()
{
TFT_BL_ON; //turn on the background light
Tft.TFTinit(); //init TFT library
Tft.drawCircle(120,160,50,0xffff);
Tft.drawCircle(50,50,50,0xff00);
Tft.drawCircle(190,50,50,0x00ff);
Tft.drawCircle(50,269,50,0xf00f);
Tft.drawCircle(190,269,50,0x0ff0);
delay(1000);
Tft.sendCMD(0x37); //Vertical Scrolling Start Adress
Tft.WRITE_DATA(0x0001);
Tft.WRITE_DATA(0x0001);
Tft.sendCMD(0x29); //Display on
}
void loop()
{
}
Any advice is apreciated.
My goal would be a little game, where I need to scroll the stuff on the screen, and have some sprites on it.
Well, maybe it isn´t possible.
Cheers Andre