[help] Interfacing with HX8347 color display

I’ve recently tried to interface my arduino with my 262k color touch screen lcd using the 3 wire serial but with no luck… I have found that I could use the shiftOut fuction for this and can easily send out 16 bit or 32 bit information. but havent had any luck with this though…

is there anyone that have worked with a display that uses the HX8347 internally?

Any advice would be greatly appriciated… :slight_smile:

How have you wired it up? What commands have you tried sending to it? What are you expecting to see?

This interface is for writing to registers for setting it up. You need to feed it with RGB parallel data to see anything. What are you using to generate this?

Well just wired it up according to the data sheet with the clock, SDI for data in, SDO for data out which is pretty useless as im not really trying to read any data from the screen and all the rest....

Well i first send a whole list of commands for setting up the registers that i found for the pic32 and hoping that most of them stays the same..

The datasheet does show that you can send the RGB commands to the display via serial as long as the value "0x22" is written in the index register to indicate to it the it needs to write the next information to the GRAM....

So I set the TRI(1-0) to 01 to indicate to it that i want to use the 262k color mode...

Im using the shiftOut() command to generate the Serial data and manually digitalWrite for the chip select... not too sure at what clock speed the LCD needs as i cant find any information on that....

Many thanks..

I realise this thread is a bit old now but i am also working with a HX8347-a controlled display http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1291412292/9#9 although i am talking to it on a parallel bus not 3wire, room for improvement but its working great so far

Wow thats awesome... Could you post the circuit diagram and your code if possible?

Many thanks Frans

Well I haven't really got as far as documenting it yet but i can tell you how far i have got up to now, BTW i am using a atmega1280 with the lcd in 16bit mode, it would be just as feasable to use a Duemilanove with an 8 bit bus and just use a latch for the upper 8 bits. with regard to the pinout I have PORTA driving LCD Bits 0-7 PORTC driving LCD Bits 8-15 PORTL driving the 5 control lines of which one is RD which is not really needed so you could get away with only 4 lines I cannot post the code as it's too many chars, and it won't let me but i can post the code over multiple post's eventually creating a library when i figure out how.

8x12 font

char zifu[]={         
/*--     --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- !  --*/
0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00,
/*-- "  --*/
0x00,0x28,0x50,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- #  --*/
0x00,0x00,0x28,0x28,0xFC,0x28,0x50,0xFC,0x50,0x50,0x00,0x00,
/*-- $  --*/
0x00,0x20,0x78,0xA8,0xA0,0x60,0x30,0x28,0xA8,0xF0,0x20,0x00,
/*-- %  --*/
0x00,0x00,0x48,0xA8,0xB0,0x50,0x28,0x34,0x54,0x48,0x00,0x00,
/*-- &  --*/
0x00,0x00,0x20,0x50,0x50,0x78,0xA8,0xA8,0x90,0x6C,0x00,0x00,
/*-- '  --*/
0x00,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- (  --*/
0x00,0x04,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x04,0x00,
/*-- )  --*/
0x00,0x40,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x40,0x00,
/*-- *  --*/
0x00,0x00,0x00,0x20,0xA8,0x70,0x70,0xA8,0x20,0x00,0x00,0x00,
/*-- +  --*/
0x00,0x00,0x20,0x20,0x20,0xF8,0x20,0x20,0x20,0x00,0x00,0x00,
/*-- ,  --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x80,
/*-- -  --*/
0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- .  --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
/*-- /  --*/
0x00,0x08,0x10,0x10,0x10,0x20,0x20,0x40,0x40,0x40,0x80,0x00,
/*-- 0  --*/
0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00,
/*-- 1  --*/
0x00,0x00,0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,
/*-- 2  --*/
0x00,0x00,0x70,0x88,0x88,0x10,0x20,0x40,0x80,0xF8,0x00,0x00,
/*-- 3  --*/
0x00,0x00,0x70,0x88,0x08,0x30,0x08,0x08,0x88,0x70,0x00,0x00,
/*-- 4  --*/
0x00,0x00,0x10,0x30,0x50,0x50,0x90,0x78,0x10,0x18,0x00,0x00,
/*-- 5  --*/
0x00,0x00,0xF8,0x80,0x80,0xF0,0x08,0x08,0x88,0x70,0x00,0x00,
/*-- 6  --*/
0x00,0x00,0x70,0x90,0x80,0xF0,0x88,0x88,0x88,0x70,0x00,0x00,
/*-- 7  --*/
0x00,0x00,0xF8,0x90,0x10,0x20,0x20,0x20,0x20,0x20,0x00,0x00,
/*-- 8  --*/
0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x88,0x70,0x00,0x00,
/*-- 9  --*/
0x00,0x00,0x70,0x88,0x88,0x88,0x78,0x08,0x48,0x70,0x00,0x00,
/*-- :  --*/
0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x20,0x00,0x00,
/*-- ;  --*/
0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x20,0x00,
/*-- <  --*/
0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00,
/*-- =  --*/
0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,
/*-- >  --*/
0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00,
/*-- ?  --*/
0x00,0x00,0x70,0x88,0x88,0x10,0x20,0x20,0x00,0x20,0x00,0x00,
/*-- @  --*/
0x00,0x00,0x70,0x88,0x98,0xA8,0xA8,0xB8,0x80,0x78,0x00,0x00,
/*-- A  --*/
0x00,0x00,0x20,0x20,0x30,0x50,0x50,0x78,0x48,0xCC,0x00,0x00,
/*-- B  --*/
0x00,0x00,0xF0,0x48,0x48,0x70,0x48,0x48,0x48,0xF0,0x00,0x00,
/*-- C  --*/
0x00,0x00,0x78,0x88,0x80,0x80,0x80,0x80,0x88,0x70,0x00,0x00,
/*-- D  --*/
0x00,0x00,0xF0,0x48,0x48,0x48,0x48,0x48,0x48,0xF0,0x00,0x00,
/*-- E  --*/
0x00,0x00,0xF8,0x48,0x50,0x70,0x50,0x40,0x48,0xF8,0x00,0x00,
/*-- F  --*/
0x00,0x00,0xF8,0x48,0x50,0x70,0x50,0x40,0x40,0xE0,0x00,0x00,
/*-- G  --*/
0x00,0x00,0x38,0x48,0x80,0x80,0x9C,0x88,0x48,0x30,0x00,0x00,
/*-- H  --*/
0x00,0x00,0xCC,0x48,0x48,0x78,0x48,0x48,0x48,0xCC,0x00,0x00,
/*-- I  --*/
0x00,0x00,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0xF8,0x00,0x00,
/*-- J  --*/
0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0xE0,0x00,
/*-- K  --*/
0x00,0x00,0xEC,0x48,0x50,0x60,0x50,0x50,0x48,0xEC,0x00,0x00,
/*-- L  --*/
0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x44,0xFC,0x00,0x00,
/*-- M  --*/
0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xA8,0xA8,0xA8,0xA8,0x00,0x00,
/*-- N  --*/
0x00,0x00,0xDC,0x48,0x68,0x68,0x58,0x58,0x48,0xE8,0x00,0x00,
/*-- O  --*/
0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,0x00,
/*-- P  --*/
0x00,0x00,0xF0,0x48,0x48,0x70,0x40,0x40,0x40,0xE0,0x00,0x00,
/*-- Q  --*/
0x00,0x00,0x70,0x88,0x88,0x88,0x88,0xE8,0x98,0x70,0x18,0x00,
/*-- R  --*/
0x00,0x00,0xF0,0x48,0x48,0x70,0x50,0x48,0x48,0xEC,0x00,0x00,
/*-- S  --*/
0x00,0x00,0x78,0x88,0x80,0x60,0x10,0x08,0x88,0xF0,0x00,0x00,
/*-- T  --*/
0x00,0x00,0xF8,0xA8,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00,
/*-- U  --*/
0x00,0x00,0xCC,0x48,0x48,0x48,0x48,0x48,0x48,0x30,0x00,0x00,
/*-- V  --*/
0x00,0x00,0xCC,0x48,0x48,0x50,0x50,0x30,0x20,0x20,0x00,0x00,
/*-- W  --*/
0x00,0x00,0xA8,0xA8,0xA8,0x70,0x50,0x50,0x50,0x50,0x00,0x00,
/*-- X  --*/
0x00,0x00,0xD8,0x50,0x50,0x20,0x20,0x50,0x50,0xD8,0x00,0x00,
/*-- Y  --*/
0x00,0x00,0xD8,0x50,0x50,0x20,0x20,0x20,0x20,0x70,0x00,0x00,
/*-- Z  --*/
0x00,0x00,0xF8,0x90,0x10,0x20,0x20,0x40,0x48,0xF8,0x00,0x00,
/*-- [  --*/
0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x00,
/*-- \  --*/
0x00,0x40,0x40,0x40,0x20,0x20,0x10,0x10,0x10,0x08,0x00,0x00,
/*-- ]  --*/
0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00,
/*-- ^  --*/
0x00,0x20,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- _  --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,
/*-- `  --*/
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- a  --*/
0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x38,0x48,0x3C,0x00,0x00,
/*-- b  --*/
0x00,0x00,0xC0,0x40,0x40,0x70,0x48,0x48,0x48,0x70,0x00,0x00,
/*-- c  --*/
0x00,0x00,0x00,0x00,0x00,0x38,0x48,0x40,0x40,0x38,0x00,0x00,
/*-- d  --*/
0x00,0x00,0x18,0x08,0x08,0x38,0x48,0x48,0x48,0x3C,0x00,0x00,
/*-- e  --*/
0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x78,0x40,0x38,0x00,0x00,
/*-- f  --*/
0x00,0x00,0x1C,0x20,0x20,0x78,0x20,0x20,0x20,0x78,0x00,0x00,
/*-- g  --*/
0x00,0x00,0x00,0x00,0x00,0x3C,0x48,0x30,0x40,0x78,0x44,0x38,
/*-- h  --*/
0x00,0x00,0xC0,0x40,0x40,0x70,0x48,0x48,0x48,0xEC,0x00,0x00,
/*-- i  --*/
0x00,0x00,0x20,0x00,0x00,0x60,0x20,0x20,0x20,0x70,0x00,0x00,
/*-- j  --*/
0x00,0x00,0x10,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0xE0,
/*-- k  --*/
0x00,0x00,0xC0,0x40,0x40,0x5C,0x50,0x70,0x48,0xEC,0x00,0x00,
/*-- l  --*/
0x00,0x00,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0xF8,0x00,0x00,
/*-- m  --*/
0x00,0x00,0x00,0x00,0x00,0xF0,0xA8,0xA8,0xA8,0xA8,0x00,0x00,
/*-- n  --*/
0x00,0x00,0x00,0x00,0x00,0xF0,0x48,0x48,0x48,0xEC,0x00,0x00,
/*-- o  --*/
0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x30,0x00,0x00,
/*-- p  --*/
0x00,0x00,0x00,0x00,0x00,0xF0,0x48,0x48,0x48,0x70,0x40,0xE0,
/*-- q  --*/
0x00,0x00,0x00,0x00,0x00,0x38,0x48,0x48,0x48,0x38,0x08,0x1C,
/*-- r  --*/
0x00,0x00,0x00,0x00,0x00,0xD8,0x60,0x40,0x40,0xE0,0x00,0x00,
/*-- s  --*/
0x00,0x00,0x00,0x00,0x00,0x78,0x40,0x30,0x08,0x78,0x00,0x00,
/*-- t  --*/
0x00,0x00,0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x18,0x00,0x00,
/*-- u  --*/
0x00,0x00,0x00,0x00,0x00,0xD8,0x48,0x48,0x48,0x3C,0x00,0x00,
/*-- v  --*/
0x00,0x00,0x00,0x00,0x00,0xEC,0x48,0x50,0x30,0x20,0x00,0x00,
/*-- w  --*/
0x00,0x00,0x00,0x00,0x00,0xA8,0xA8,0x70,0x50,0x50,0x00,0x00,
/*-- x  --*/
0x00,0x00,0x00,0x00,0x00,0xD8,0x50,0x20,0x50,0xD8,0x00,0x00,
/*-- y  --*/
0x00,0x00,0x00,0x00,0x00,0xEC,0x48,0x50,0x30,0x20,0x20,0xC0,
/*-- z  --*/
0x00,0x00,0x00,0x00,0x00,0x78,0x10,0x20,0x20,0x78,0x00,0x00,
/*-- {  --*/
0x00,0x18,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x18,0x00,
/*-- |  --*/
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
/*-- }  --*/
0x00,0x60,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x60,0x00,
/*-- ~  --*/
0x40,0xA4,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};

LCD Init

void main_init(void)
{

  PORTL |= _BV(PL4);//   digitalWrite(LCD_REST, HIGH);
  delay(5);      
  PORTL &=~ _BV(PL4);//   digitalWrite(LCD_REST, LOW);
  delay(10);
  PORTL |= _BV(PL4);//  digitalWrite(LCD_REST, HIGH);
  delay(20);

         //  VENDOR   
      main_W_com_data(0x0046,0x00A4);
      main_W_com_data(0x0047,0x0053);
      main_W_com_data(0x0048,0x0000);
      main_W_com_data(0x0049,0x0044);
      main_W_com_data(0x004a,0x0004);
      main_W_com_data(0x004b,0x0067);
      main_W_com_data(0x004c,0x0033);
      main_W_com_data(0x004d,0x0077);
      main_W_com_data(0x004e,0x0012);
      main_W_com_data(0x004f,0x004C);
      main_W_com_data(0x0050,0x0046);
      main_W_com_data(0x0051,0x0044);
        
        //240x320 window setting
    main_W_com_data(0x0002,0x0000); // Column address start2
       main_W_com_data(0x0003,0x0000); // Column address start1
       main_W_com_data(0x0004,0x0000); // Column address end2
       main_W_com_data(0x0005,0x00ef); // Column address end1
    main_W_com_data(0x0006,0x0000); // Row address start2
      main_W_com_data(0x0007,0x0000); // Row address start1
      main_W_com_data(0x0008,0x0001); // Row address end2
      main_W_com_data(0x0009,0x003f); // Row address end1
  
  // Display Setting
      main_W_com_data(0x0001,0x0006); // IDMON=0, INVON=1, NORON=1, PTLON=0
      main_W_com_data(0x0016,0x00C8); // MY=0, MX=0, MV=0, ML=1, BGR=0, TEON=0   0048
      main_W_com_data(0x0023,0x0095); // N_DC=1001 0101
      main_W_com_data(0x0024,0x0095); // PI_DC=1001 0101
      main_W_com_data(0x0025,0x00FF); // I_DC=1111 1111
      
      main_W_com_data(0x0027,0x0002); // N_BP=0000 0010
      main_W_com_data(0x0028,0x0002); // N_FP=0000 0010
      main_W_com_data(0x0029,0x0002); // PI_BP=0000 0010
      main_W_com_data(0x002a,0x0002); // PI_FP=0000 0010
      main_W_com_data(0x002C,0x0002); // I_BP=0000 0010
      main_W_com_data(0x002d,0x0002); // I_FP=0000 0010
      
      main_W_com_data(0x003a,0x0001); // N_RTN=0000, N_NW=001    0001
      main_W_com_data(0x003b,0x0000); // P_RTN=0000, P_NW=001
      main_W_com_data(0x003c,0x00f0); // I_RTN=1111, I_NW=000
      main_W_com_data(0x003d,0x0000); // DIV=00
  delay(1);
      main_W_com_data(0x0035,0x0038); // EQS=38h
      main_W_com_data(0x0036,0x0078); // EQP=78h
      main_W_com_data(0x003E,0x0038); // SON=38h
      main_W_com_data(0x0040,0x000F); // GDON=0Fh
      main_W_com_data(0x0041,0x00F0); // GDOFF
      
      // Power Supply Setting
      main_W_com_data(0x0019,0x0049); // CADJ=0100, CUADJ=100, OSD_EN=1 ,60Hz
      main_W_com_data(0x0093,0x000F); // RADJ=1111, 100%
  delay(1);
      main_W_com_data(0x0020,0x0040); // BT=0100
      main_W_com_data(0x001D,0x0007); // VC1=111   0007
      main_W_com_data(0x001E,0x0000); // VC3=000
      main_W_com_data(0x001F,0x0004); // VRH=0011
      
      //VCOM SETTING
      main_W_com_data(0x0044,0x004D); // VCM=101 0000  4D
      main_W_com_data(0x0045,0x000E); // VDV=1 0001   0011
  delay(1);
      main_W_com_data(0x001C,0x0004); // AP=100
  delay(2);
      
      main_W_com_data(0x001B,0x0018); // GASENB=0, PON=0, DK=1, XDK=0, VLCD_TRI=0, STB=0
  delay(1);
      main_W_com_data(0x001B,0x0010); // GASENB=0, PON=1, DK=0, XDK=0, VLCD_TRI=0, STB=0
  delay(1);
      main_W_com_data(0x0043,0x0080); //set VCOMG=1
  delay(2);
      
      // Display ON Setting
      main_W_com_data(0x0090,0x007F); // SAP=0111 1111
      main_W_com_data(0x0026,0x0004); //GON=0, DTE=0, D=01
  delay(1);
      main_W_com_data(0x0026,0x0024); //GON=1, DTE=0, D=01
      main_W_com_data(0x0026,0x002C); //GON=1, DTE=0, D=11
  delay(1);
      main_W_com_data(0x0026,0x003C); //GON=1, DTE=1, D=11
      
      // INTERNAL REGISTER SETTING
      main_W_com_data(0x0057,0x0002); // TEST_Mode=1: into TEST mode
      main_W_com_data(0x0095,0x0001); // SET DISPLAY CLOCK AND PUMPING CLOCK TO SYNCHRONIZE
      main_W_com_data(0x0057,0x0000); // TEST_Mode=0: exit TEST mode
      //main_W_com_data(0x0021,0x0000);
      main_Write_COM(0x0022);  

}

Control functions

void main_Write_COM( int  DH)
{      
  PORTL &=~ _BV(PL0);//  digitalWrite(LCD_RS, LOW);
  PORTL &=~ _BV(PL3);//  digitalWrite(LCD_CS, LOW);             
  PORTC=DH>>8;      
  PORTA=DH;            
  PORTL &=~ _BV(PL1);//  digitalWrite(LCD_WR, LOW);
  PORTL |= _BV(PL1);//  digitalWrite(LCD_WR, HIGH);
  PORTL |= _BV(PL3);//  digitalWrite(LCD_CS, HIGH);
}

void main_Write_DATA(int DH)
{
  PORTL |= _BV(PL0);//  digitalWrite(LCD_RS, HIGH);
  PORTL &=~ _BV(PL3);//  digitalWrite(LCD_CS, LOW);
  PORTC=DH>>8;      
  PORTA=DH;
  PORTL &=~ _BV(PL1);//  digitalWrite(LCD_WR, LOW);
  PORTL |= _BV(PL1);//  digitalWrite(LCD_WR, HIGH);
  PORTL |= _BV(PL3);//  digitalWrite(LCD_CS, HIGH);
}


void main_W_com_data( int com1, int dat1)      //ÃüÁîÊý¾ÝÒ»Æð 
{
   main_Write_COM(com1);
   main_Write_DATA(dat1);
}



void address_set(int x1,int y1,int x2, int y2)
{
      main_W_com_data(0x0002,x1>>8);         // Column address start2
      main_W_com_data(0x0003,x1);         // Column address start1
      main_W_com_data(0x0004,x2>>8);         // Column address end2
      main_W_com_data(0x0005,x2);         // Column address end1
      main_W_com_data(0x0006,y1>>8);         // Row address start2
      main_W_com_data(0x0007,y1);         // Row address start1
    main_W_com_data(0x0008,y2>>8);         // Row address end2
      main_W_com_data(0x0009,y2);         // Row address end1
    main_Write_COM(0x0022);             

}      


void Pant( int color)
{
      int i,j;
      address_set(0,0,239,319);

    for(i=0;i<320;i++)
       {
        for (j=0;j<240;j++)
               {
         main_Write_DATA(color);
          }

        }            
}
void inttostr(int dd,char *str)
{
      str[0]=dd/10000+48;
      str[1]=(dd/1000)-((dd/10000)*10)+48;
      str[2]=(dd/100)-((dd/1000)*10)+48;
      str[3]=(dd/10)-((dd/100)*10)+48;
      str[4]=dd-((dd/10)*10)+48;
      str[5]=0;
}


void showzifu(int x,int y,char value,int dcolor,int bgcolor)      
{  
      char i,j;
      char *temp=zifu;    
    address_set(x,y,x+7,y+11); //ÉèÖÃÇøÓò      
      temp+=(value-32)*12;
      for(j=0;j<12;j++)
      {
            for(i=0;i<8;i++)
            {                  
                   if((*temp&(1<<(7-i)))!=0)
                  {
                        main_Write_DATA(dcolor);
                  } 
                  else
                  {
                        main_Write_DATA(bgcolor);
                  }   
            }
            temp++;
       }
}

void showzifustr(int x,int y, char *str,int dcolor,int bgcolor)        
{  
      int x1,y1;
      x1=x;
      y1=y;
      while(*str!='\0')
      {      
            showzifu(x1,y1,*str,dcolor,bgcolor);
            x1+=7;
            str++;
      }      
}

Writes “Arduino” to the screen and scrolls it left to right then back
I can’t take any credit for this code as it is freely available for the 8051 uC, i’ve only adapted it to Arduino with some help from PPL on this forum

void setup()
{
  DDRA = 255;
  DDRC = 255;
  DDRL = 27;
}
void loop()
{

      char ss[6];      
      int lx,ly;

      main_init();   //tft³õʼ»¯       
      Pant(0xffff);
      
        
      while(1)
      { 
          for(int dx=0; dx<190; dx++)
          {
            
            showzifustr(dx,155,"Arduino",0,0xffff);
            delay(10);
            
                   
          }
        
                   for(int dx=190; dx>0; dx-=1)
          {
            
            showzifustr(dx,155,"Arduino",0,0xffff);
                        delay(10);
                   
          }
       
     
   
  }



}