Tuesday 7 June 2011

LCD Tutorial 7


Tutorial 7 - Marquee part 2      

This project proves to be more challenging than tutorial 7. Instead of using command_shift, I simply rely on the display address in order to move the letter across the LCD module from right to left. Each letter starts at 0x90 which cannot be seen on the LCD panel (See more information  in tutorial 3). 

Each letter moves backward until it reaches on the 1st character on the 1st line. The second letter will stop at 2nd character of the LCD module, third letter stop at third character. It keeps going until the letter run out. The codes has been hardly changed apart from the character_mode prototype function as it needs to be modified in order to operate as marquee.

// Prototype function 
void character_mode(tByte *s)
{
        tByte string,ADDRESS=0X90;
        tWord x,P;
// Switch character mode on 
// RS=ON
        P=16;

        while(*s != 0x0)
        {

                string=*s;

                for (x=0; x<=P; ++x)
                {
         
       RS=ON;
                table_lookup(string);
                pulse_e();
 
               RS=OFF; 
                RS=ON;
                DATA=0x20;
                pulse_e();
                RS=OFF;

                --ADDRESS;
                display_address(ADDRESS);
                Delay_Loop(5);
            }
                        s++;
                        ADDRESS=0x90;
                        display_address(ADDRESS);

                        --P;

        }
}


No comments:

Post a Comment