Circuit Negma

C++, C, VB.NET, PCB, Electronics, Circuit Design

20×4 LCD :: Display Big Letters

Posted by Circuit Negma on December 26, 2009


Created By: Hussein Nosair

Code Snippet
  1. /***********************************************************************/
  2. /*                   LCD BIG LETTERS Test Program                         */
  3. /*                                                                     */
  4. /*  Created By: Hussein Nosair                                         */
  5. /*  Date      : 12/25/2009                                             */
  6. /*  Project   : LCDLOGO_18f4520_20091225                               */
  7. /*  Proj. Path: C:\\tab                                                    */
  8. /*  File Name : test.c                                                 */
  9. /*                                                                     */
  10. /*    Description:                                                       */
  11. /*            This project will attempt to accomplish the following:       */
  12. /*            1. Utilize the LCD abilities of creating Custom Character  */
  13. /*                to build customized building blocks of the alphabets.  */
  14. /*            2. Utilize pre defined LCD characters.                       */
  15. /*            3. Define every alphabet letter pattern using the           */
  16. /*                customized building blocks.    Each letter will consist of*/
  17. /*                12 building blocks, 3 blocks per line/row.               */
  18. /*            4. At this time, we will display a pre-coded message       */
  19. /*                "HELLO" using 20×4 LCD. 20×4 LCD will only support 5   */
  20. /*                letters message at a time.                               */
  21. /*                                                                       */
  22. /*    Hardware:                                                           */
  23. /*            PIC18F4520                                                   */
  24. /*            External Clock (Oscillator) = 10MHz                           */
  25. /*            Internal Clock (Oscillator) = 40Hz                           */
  26. /*            LCD: 20×4 HDM20416L-1-YA0S                                   */
  27. /* Software:                                                           */
  28. /*            Editor:   MPLAB IDE v8.40                                   */
  29. /*            Compiler: MPLAB C18 3.34                                   */
  30. /*            Internal clock is set to 4xPLL = 4x10MHz = 40MHz           */
  31. /*                                                                       */
  32. /*                                                                       */
  33. /* Author               Date      Comment                              */
  34. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  35. /* Hussein Nosair        12/25/09  test.c created                       */
  36. /***********************************************************************/
  37.  
  38.  
  39. /***********************************************************************/
  40. /*                      DEFINE THE MOTHER CODE                         */
  41. /***********************************************************************/
  42. //#define THIS_IS_STACK_APPLICATION               // Define this file to be the main Proj.'s File
  43.  
  44.  
  45. /***********************************************************************/
  46. /*                      DEFINE THE LIBRARIES                           */
  47. /***********************************************************************/
  48.                            #include "Compiler.h"// Compiler configuration library
  49.                                                 // define which compiler headers to use
  50.                     #include "HardwareProfile.h"// Hardware configuration library
  51.                                                 // define Configuration bits of PIC18F uC
  52. //#include "GenericTypeDefs.h"                  // Global definition library
  53.                                                 // contains user Type definitions
  54. //#include "Global_Variables.h"                 // Global variables library
  55.                                                 // contains user defined global variables
  56.                                 #include "LCD.h"// LCD library
  57.                                                 // contains functions related to operation of LCD
  58. //#include "keys_scan.h"                        // Keypad keys library
  59. //#include "sound.h"                            // Sound library
  60. //#include "Tick.h"                             // Ethernet (Clock) ticker library
  61.  
  62.  
  63. /***********************************************************************/
  64. /*                     DEFINE STATIC VARIABLES                         */
  65. /***********************************************************************/
  66. #define TIMER1_LED_DELAY        2               // LED Timeout = 2*1.67sec
  67.  
  68. #define EMPTY_BLOCK_PATTERN        0xFE            // Pre-defined pattern by LCD
  69. #define FULL_BLOCK_PATTERN        0xFF            // Pre-defined pattern by LCD
  70.  
  71.  
  72. /***********************************************************************/
  73. /*                     DEFINE GLOBAL VARIABLES                         */
  74. /***********************************************************************/
  75. unsigned char LEDTime;                          // Define LED timout
  76. //unsigned char dwInternalTicks;                // Define Ethernet tick counter
  77.  
  78. // Define customized building blocks of alphabets letters.
  79. //———————————————————
  80. const unsigned char aShapes[8][8] = { {0 , 0 , 0 , 1 , 3 , 7 , 15 , 31},        // Patter 1 saved to LCD RAM @ 0
  81.                                          {0 , 0 , 0 , 16 , 24 , 28 , 30 , 31},        // Patter 2 saved to LCD RAM @ 1
  82.                                          {31 , 15 , 7 , 3 , 1 , 0 , 0 , 0},        // Patter 3 saved to LCD RAM @ 2
  83.                                          {31 , 30 , 28 , 24 , 16 , 0 , 0 , 0},        // Patter 4 saved to LCD RAM @ 3
  84.                                          {0 , 0 , 0 , 31 , 31 , 31 , 31 , 31},        // Patter 5 saved to LCD RAM @ 4
  85.                                          {31 , 31 , 31 , 31 , 31 , 0 , 0 , 0},        // Patter 6 saved to LCD RAM @ 5
  86.                                          {31 , 31 , 31 , 30 , 28 , 24 , 16 , 0},    // Patter 7 saved to LCD RAM @ 6
  87.                                          {0 , 16 , 24 , 28 , 30 , 31 , 31 , 31}    // Patter 8 saved to LCD RAM @ 7
  88.                                     };
  89.  
  90. // Define message of 5 letters to be displayed on the LCD
  91. //———————————————————                                
  92. unsigned char aText[6] = "HELLO";
  93.  
  94. unsigned char *paText;                            // Define the letter to be displayed
  95. unsigned char xPos;                                // Define the LCD cursor location
  96.  
  97.  
  98. /***********************************************************************/
  99. /*                     DEFINE PRIVATE SUBROUTINES                      */
  100. /***********************************************************************/
  101. // Define Board's hardware initialization subroutine
  102. //—————————————————-
  103. void InitializeBoard(void);                     
  104.  
  105. // Define letters of alphabets patters
  106. //—————————————————-
  107. void DrawCharacter(unsigned char *pStr, unsigned char *pxPos);
  108.  
  109.  
  110. /***********************************************************************/
  111. /*                     PIC18 Interrupt Service Routines                */
  112. /***********************************************************************/
  113.     #pragma interruptlow LowISR
  114.     void LowISR(void)
  115.     {
  116.         if(INTCONbits.TMR0IF)                   // Check for Timer 0 interrupt
  117.         {
  118.             if (LEDTime)                        // If not already down to zero
  119.             {
  120.                 LEDTime–;                        // Countdown 1 tic
  121.             }
  122.     
  123.             INTCONbits.TMR0IF = 0;              // Reset interrupt flag
  124.             TMR0H = 0x00;                       // Reload Timer 0, upper bits, 1.67 secs
  125.             TMR0L = 0x00;                       // Reload Timer 0, lower bits
  126.         }
  127.     }
  128.     
  129.     #pragma interruptlow HighISR
  130.     void HighISR(void){}
  131.     #pragma code lowVector=0x18
  132.     void LowVector(void){_asm goto LowISR _endasm}
  133.     #pragma code highVector=0x8
  134.     void HighVector(void){_asm goto HighISR _endasm}
  135.     #pragma code // Return to default code section
  136.  
  137.  
  138. /********************************************************************/
  139. /*                     MAIN PROGRAM ROUTINE                         */
  140. /********************************************************************/
  141. void main(void)
  142. {
  143.     unsigned char i;
  144.           
  145.     /************** INITIALIZE THE BOARD ************/
  146.     InitializeBoard();                  // Initialize board and PIC hardware
  147.  
  148.     /************** PREPARE THE LCD ****************/
  149.     LCDErase();                         // Clear the LCD
  150.     LCDHome();
  151.  
  152.     // Load Custom Characters into LCD RAM
  153.     //—————————————
  154.     for(i=0;i<8;i++)
  155.     {
  156.         LCDCustomChar(i, aShapes[i]);
  157.         LCD_PAUSE();
  158.     }
  159.     
  160.     // Init. Text array pointer
  161.     //—————————
  162.     paText = &aText[0];
  163.     xPos = 0;
  164.         
  165.     
  166.     /********************** MAIN PROGRAM INFINITE LOOP *******************/
  167.     while(1)                                    // Loop infinitly
  168.     {
  169.         if (!LEDTime)                            // Check LED time out.
  170.         {
  171.             // Toggle LED
  172.             //—————————–
  173.             LED_IO ^= 1;                         // Turn of LED after some delay indicating no using keypad
  174.  
  175.             // Display Text array message
  176.             //—————————-
  177.             paText = &aText[0];
  178.             xPos = 0;
  179.             for(i=0; i<5; i++)
  180.             {
  181.                 DrawCharacter(paText, &xPos);
  182.                 *paText++;
  183.                 xPos += 4;
  184.             }
  185.             LEDTime = 1;
  186.             while(LEDTime);
  187.             LCDErase();
  188.             
  189.             LEDTime = TIMER1_LED_DELAY;            // Restart counter.
  190.         }
  191.  
  192.  
  193.         ClrWdt();                               // Clear Watchdog timer
  194.  
  195.     }       
  196. }
  197.  
  198. /********************************************************************
  199. *       Function Name:  InitializeBoard                             *
  200. *       Return Value:   None                                        *
  201. *       Parameters:     void                                        *
  202. *       Description:    This routine initialize the on board's      *
  203. *                       modules and microprocessor.                 *
  204. ********************************************************************/
  205. void InitializeBoard(void)
  206. {
  207.     RCON    = 0x80;
  208.     INTCON  = 0xE0;
  209.     INTCON2 = 0x84;
  210.     INTCON3 = 0x00;
  211.     
  212.     #if defined(__18F97J60)
  213.         PIR1 = 0x00;
  214.         PIR2 = 0x00;
  215.         PIR3 = 0x00;
  216.         PIE1 = 0x00;
  217.         PIE2 = 0x00;
  218.         PIE3 = 0x00;
  219.         LATA = 0xC0;
  220.     #endif
  221.     
  222.     // Initiailize Digital Pins
  223.     //—————————-
  224.     ADCON1 = 0x0F;              // Analog pins to digital
  225.     CMCON = 0x00; //0xCF;
  226.     CVRCON = 0x00;
  227.     
  228.     #if defined(__18F97J60)
  229.         PORTAbits.RJPU = 0;
  230.     #endif
  231.  
  232.     // Enable internal PORTB pull-ups
  233.     //—————————-
  234.     INTCON2bits.RBPU = 1;
  235.     
  236.     // Enable Interrupts
  237.     //—————————-
  238.     RCONbits.IPEN = 1;            // Enable interrupt priorities
  239.     INTCONbits.GIEH = 1;
  240.     INTCONbits.GIEL = 1;
  241.  
  242.     // Set Internal Oscillator/Clock
  243.     //—————————-
  244.     OSCTUNE = 0x00;             //<———–
  245.     
  246.     // Initialize LEDs
  247.     //————————–
  248.     LED_TRIS = 0;
  249.     LED_IO = 0;
  250.  
  251.     // Initialize LCD
  252.     //————————–
  253.     LCD_DATA_TRIS = 0x0F;   // Set Data Bus Direction to output
  254.     LCD_RD_WR_TRIS  = 0;    // Set R/W pin direction to output
  255.     LCD_RS_TRIS     = 0;    // Set Reset pin direction to output
  256.     LCD_E_TRIS      = 0;    // Set Enable pin direction to output
  257.     DelayMs(50);            // wait for 15ms to allow the voltage to  rise to moe than 4.5V
  258.     LCDInit();
  259.     
  260.     // Initialize KEYs
  261. //    Keys_init();
  262.     
  263.     // Initialize Speaker
  264. //    BUZZER_TRIS = 0;
  265. //    BUZZER = 0;
  266.  
  267.     // Initialize Timer 0
  268.     //————————–
  269.     // Use Timer0 for 8 bit processors
  270.     // Initialize the time
  271.     TMR0H = 0;
  272.     TMR0L = 0;
  273.  
  274.     // Set up the timer interrupt
  275.     INTCON2bits.TMR0IP = 0;        // Low priority
  276.     INTCONbits.TMR0IF = 0;
  277.     INTCONbits.TMR0IE = 1;        // Enable interrupt
  278.  
  279.     // Timer0 on, 16-bit, internal timer, 1:256 prescalar
  280.     T0CON = 0x87;
  281.  
  282.  
  283.     // Start Clock
  284. //    TickInit();    
  285. }
  286.  
  287. /********************************************************************
  288. *       Function Name:  DrawCharacter                                *
  289. *       Return Value:   None                                        *
  290. *       Parameters:     letter pointer, cursor location pointer     *
  291. *       Description:    This routine will display the capital       *
  292. *                       letter of characters defined in the message *
  293. ********************************************************************/
  294. void DrawCharacter(unsigned char *pStr, unsigned char *pxPos)
  295. {
  296.         if(*pStr == 'a' || *pStr == 'A')
  297.         {
  298.             LCD_Move(1, *pxPos);
  299.             LCDReadCustomChar(0);
  300.             LCDReadCustomChar(4);
  301.             LCDReadCustomChar(1);
  302.  
  303.             LCD_Move(2, *pxPos);
  304.             LCDWriteData(FULL_BLOCK_PATTERN);
  305.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  306.             LCDWriteData(FULL_BLOCK_PATTERN);
  307.  
  308.             LCD_Move(3, *pxPos);
  309.             LCDWriteData(FULL_BLOCK_PATTERN);
  310.             LCDReadCustomChar(5);
  311.             LCDWriteData(FULL_BLOCK_PATTERN);
  312.  
  313.             LCD_Move(4, *pxPos);
  314.             LCDReadCustomChar(5);
  315.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  316.             LCDReadCustomChar(5);
  317.             
  318.             return;
  319.         }    
  320.         else if(*pStr == 'b' || *pStr == 'B')
  321.         {
  322.             LCD_Move(1, *pxPos);
  323.             LCDReadCustomChar(4);
  324.             LCDReadCustomChar(4);
  325.             LCDReadCustomChar(1);
  326.  
  327.             LCD_Move(2, *pxPos);
  328.             LCDWriteData(FULL_BLOCK_PATTERN);
  329.             LCDReadCustomChar(0);
  330.             LCDReadCustomChar(6);
  331.  
  332.             LCD_Move(3, *pxPos);
  333.             LCDWriteData(FULL_BLOCK_PATTERN);
  334.             LCDReadCustomChar(2);
  335.             LCDReadCustomChar(7);
  336.  
  337.             LCD_Move(4, *pxPos);
  338.             LCDReadCustomChar(5);
  339.             LCDReadCustomChar(5);
  340.             LCDReadCustomChar(3);
  341.             
  342.             return;
  343.         }    
  344.         else if(*pStr == 'c' || *pStr == 'C')
  345.         {
  346.             LCD_Move(1, *pxPos);
  347.             LCDReadCustomChar(0);
  348.             LCDReadCustomChar(4);
  349.             LCDReadCustomChar(1);
  350.  
  351.             LCD_Move(2, *pxPos);
  352.             LCDWriteData(FULL_BLOCK_PATTERN);
  353.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  354.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  355.  
  356.             LCD_Move(3, *pxPos);
  357.             LCDWriteData(FULL_BLOCK_PATTERN);
  358.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  359.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  360.  
  361.             LCD_Move(4, *pxPos);
  362.             LCDReadCustomChar(2);
  363.             LCDReadCustomChar(5);
  364.             LCDReadCustomChar(3);
  365.             
  366.             return;
  367.         }    
  368.         else if(*pStr == 'd' || *pStr == 'D')
  369.         {
  370.             LCD_Move(1, *pxPos);
  371.             LCDReadCustomChar(4);
  372.             LCDReadCustomChar(4);
  373.             LCDReadCustomChar(1);
  374.  
  375.             LCD_Move(2, *pxPos);
  376.             LCDWriteData(FULL_BLOCK_PATTERN);
  377.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  378.             LCDWriteData(FULL_BLOCK_PATTERN);
  379.  
  380.             LCD_Move(3, *pxPos);
  381.             LCDWriteData(FULL_BLOCK_PATTERN);
  382.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  383.             LCDWriteData(FULL_BLOCK_PATTERN);
  384.  
  385.             LCD_Move(4, *pxPos);
  386.             LCDReadCustomChar(5);
  387.             LCDReadCustomChar(5);
  388.             LCDReadCustomChar(3);
  389.             
  390.             return;
  391.         }    
  392.         else if(*pStr == 'e' || *pStr == 'E')
  393.         {
  394.             LCD_Move(1, *pxPos);
  395.             LCDReadCustomChar(4);
  396.             LCDReadCustomChar(4);
  397.             LCDReadCustomChar(4);
  398.  
  399.             LCD_Move(2, *pxPos);
  400.             LCDWriteData(FULL_BLOCK_PATTERN);
  401.             LCDReadCustomChar(4);
  402.             LCDReadCustomChar(4);
  403.  
  404.             LCD_Move(3, *pxPos);
  405.             LCDWriteData(FULL_BLOCK_PATTERN);
  406.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  407.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  408.  
  409.             LCD_Move(4, *pxPos);
  410.             LCDReadCustomChar(5);
  411.             LCDReadCustomChar(5);
  412.             LCDReadCustomChar(5);
  413.             
  414.             return;
  415.         }    
  416.         else if(*pStr == 'f' || *pStr == 'F')
  417.         {
  418.             LCD_Move(1, *pxPos);
  419.             LCDReadCustomChar(4);
  420.             LCDReadCustomChar(4);
  421.             LCDReadCustomChar(4);
  422.  
  423.             LCD_Move(2, *pxPos);
  424.             LCDWriteData(FULL_BLOCK_PATTERN);
  425.             LCDReadCustomChar(4);
  426.             LCDReadCustomChar(4);
  427.  
  428.             LCD_Move(3, *pxPos);
  429.             LCDWriteData(FULL_BLOCK_PATTERN);
  430.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  431.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  432.  
  433.             LCD_Move(4, *pxPos);
  434.             LCDReadCustomChar(5);
  435.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  436.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  437.             
  438.             return;
  439.         }    
  440.         else if(*pStr == 'g' || *pStr == 'G')
  441.         {
  442.             LCD_Move(1, *pxPos);
  443.             LCDReadCustomChar(0);
  444.             LCDReadCustomChar(4);
  445.             LCDReadCustomChar(1);
  446.  
  447.             LCD_Move(2, *pxPos);
  448.             LCDWriteData(FULL_BLOCK_PATTERN);
  449.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  450.             LCDReadCustomChar(5);
  451.  
  452.             LCD_Move(3, *pxPos);
  453.             LCDWriteData(FULL_BLOCK_PATTERN);
  454.             LCDReadCustomChar(5);
  455.             LCDWriteData(FULL_BLOCK_PATTERN);
  456.  
  457.             LCD_Move(4, *pxPos);
  458.             LCDReadCustomChar(2);
  459.             LCDReadCustomChar(5);
  460.             LCDReadCustomChar(3);
  461.             
  462.             return;
  463.         }    
  464.         else if(*pStr == 'h' || *pStr == 'H')
  465.         {
  466.             LCD_Move(1, *pxPos);
  467.             LCDReadCustomChar(4);
  468.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  469.             LCDReadCustomChar(4);
  470.  
  471.             LCD_Move(2, *pxPos);
  472.             LCDWriteData(FULL_BLOCK_PATTERN);
  473.             LCDReadCustomChar(4);
  474.             LCDWriteData(FULL_BLOCK_PATTERN);
  475.  
  476.             LCD_Move(3, *pxPos);
  477.             LCDWriteData(FULL_BLOCK_PATTERN);
  478.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  479.             LCDWriteData(FULL_BLOCK_PATTERN);
  480.  
  481.             LCD_Move(4, *pxPos);
  482.             LCDReadCustomChar(5);
  483.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  484.             LCDReadCustomChar(5);
  485.             
  486.             return;
  487.         }    
  488.         else if(*pStr == 'i' || *pStr == 'I')
  489.         {
  490.             LCD_Move(1, *pxPos);
  491.             LCDReadCustomChar(4);
  492.             LCDReadCustomChar(4);
  493.             LCDReadCustomChar(4);
  494.  
  495.             LCD_Move(2, *pxPos);
  496.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  497.             LCDWriteData(FULL_BLOCK_PATTERN);
  498.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  499.  
  500.             LCD_Move(3, *pxPos);
  501.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  502.             LCDWriteData(FULL_BLOCK_PATTERN);
  503.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  504.  
  505.             LCD_Move(4, *pxPos);
  506.             LCDReadCustomChar(5);
  507.             LCDReadCustomChar(5);
  508.             LCDReadCustomChar(5);
  509.             
  510.             return;
  511.         }    
  512.         else if(*pStr == 'j' || *pStr == 'J')
  513.         {
  514.             LCD_Move(1, *pxPos);
  515.             LCDReadCustomChar(4);
  516.             LCDReadCustomChar(4);
  517.             LCDReadCustomChar(4);
  518.  
  519.             LCD_Move(2, *pxPos);
  520.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  521.             LCDWriteData(FULL_BLOCK_PATTERN);
  522.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  523.  
  524.             LCD_Move(3, *pxPos);
  525.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  526.             LCDWriteData(FULL_BLOCK_PATTERN);
  527.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  528.  
  529.             LCD_Move(4, *pxPos);
  530.             LCDReadCustomChar(5);
  531.             LCDReadCustomChar(3);
  532.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  533.             
  534.             return;
  535.         }    
  536.         else if(*pStr == 'k' || *pStr == 'K')
  537.         {
  538.             LCD_Move(1, *pxPos);
  539.             LCDReadCustomChar(4);
  540.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  541.             LCDReadCustomChar(4);
  542.  
  543.             LCD_Move(2, *pxPos);
  544.             LCDWriteData(FULL_BLOCK_PATTERN);
  545.             LCDReadCustomChar(0);
  546.             LCDReadCustomChar(6);
  547.  
  548.             LCD_Move(3, *pxPos);
  549.             LCDWriteData(FULL_BLOCK_PATTERN);
  550.             LCDReadCustomChar(2);
  551.             LCDReadCustomChar(7);
  552.  
  553.             LCD_Move(4, *pxPos);
  554.             LCDReadCustomChar(5);
  555.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  556.             LCDReadCustomChar(5);
  557.             
  558.             return;
  559.         }    
  560.         else if(*pStr == 'l' || *pStr == 'L')
  561.         {
  562.             LCD_Move(1, *pxPos);
  563.             LCDReadCustomChar(4);
  564.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  565.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  566.  
  567.             LCD_Move(2, *pxPos);
  568.             LCDWriteData(FULL_BLOCK_PATTERN);
  569.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  570.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  571.  
  572.             LCD_Move(3, *pxPos);
  573.             LCDWriteData(FULL_BLOCK_PATTERN);
  574.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  575.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  576.  
  577.             LCD_Move(4, *pxPos);
  578.             LCDReadCustomChar(5);
  579.             LCDReadCustomChar(5);
  580.             LCDReadCustomChar(5);
  581.             
  582.             return;
  583.         }    
  584.         else if(*pStr == 'm' || *pStr == 'M')
  585.         {
  586.             LCD_Move(1, *pxPos);
  587.             LCDReadCustomChar(1);
  588.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  589.             LCDReadCustomChar(0);
  590.  
  591.             LCD_Move(2, *pxPos);
  592.             LCDWriteData(FULL_BLOCK_PATTERN);
  593.             LCDWriteData(FULL_BLOCK_PATTERN);
  594.             LCDWriteData(FULL_BLOCK_PATTERN);
  595.  
  596.             LCD_Move(3, *pxPos);
  597.             LCDWriteData(FULL_BLOCK_PATTERN);
  598.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  599.             LCDWriteData(FULL_BLOCK_PATTERN);
  600.  
  601.             LCD_Move(4, *pxPos);
  602.             LCDReadCustomChar(5);
  603.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  604.             LCDReadCustomChar(5);
  605.             
  606.             return;
  607.         }    
  608.         else if(*pStr == 'n' || *pStr == 'N')
  609.         {
  610.             LCD_Move(1, *pxPos);
  611.             LCDReadCustomChar(4);
  612.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  613.             LCDReadCustomChar(4);
  614.  
  615.             LCD_Move(2, *pxPos);
  616.             LCDWriteData(FULL_BLOCK_PATTERN);
  617.             LCDReadCustomChar(7);
  618.             LCDWriteData(FULL_BLOCK_PATTERN);
  619.  
  620.             LCD_Move(3, *pxPos);
  621.             LCDWriteData(FULL_BLOCK_PATTERN);
  622.             LCDReadCustomChar(2);
  623.             LCDWriteData(FULL_BLOCK_PATTERN);
  624.  
  625.             LCD_Move(4, *pxPos);
  626.             LCDReadCustomChar(5);
  627.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  628.             LCDReadCustomChar(5);
  629.             
  630.             return;
  631.         }    
  632.         else if(*pStr == 'o' || *pStr == 'O')
  633.         {
  634.             LCD_Move(1, *pxPos);
  635.             LCDReadCustomChar(0);
  636.             LCDReadCustomChar(4);
  637.             LCDReadCustomChar(1);
  638.  
  639.             LCD_Move(2, *pxPos);
  640.             LCDWriteData(FULL_BLOCK_PATTERN);
  641.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  642.             LCDWriteData(FULL_BLOCK_PATTERN);
  643.  
  644.             LCD_Move(3, *pxPos);
  645.             LCDWriteData(FULL_BLOCK_PATTERN);
  646.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  647.             LCDWriteData(FULL_BLOCK_PATTERN);
  648.  
  649.             LCD_Move(4, *pxPos);
  650.             LCDReadCustomChar(2);
  651.             LCDReadCustomChar(5);
  652.             LCDReadCustomChar(3);
  653.             
  654.             return;
  655.         }    
  656.         else if(*pStr == 'p' || *pStr == 'P')
  657.         {
  658.             LCD_Move(1, *pxPos);
  659.             LCDReadCustomChar(4);
  660.             LCDReadCustomChar(4);
  661.             LCDReadCustomChar(1);
  662.  
  663.             LCD_Move(2, *pxPos);
  664.             LCDWriteData(FULL_BLOCK_PATTERN);
  665.             LCDReadCustomChar(4);
  666.             LCDReadCustomChar(6);
  667.  
  668.             LCD_Move(3, *pxPos);
  669.             LCDWriteData(FULL_BLOCK_PATTERN);
  670.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  671.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  672.  
  673.             LCD_Move(4, *pxPos);
  674.             LCDReadCustomChar(5);
  675.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  676.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  677.             
  678.             return;
  679.         }    
  680.         else if(*pStr == 'q' || *pStr == 'Q')
  681.         {
  682.             LCD_Move(1, *pxPos);
  683.             LCDReadCustomChar(0);
  684.             LCDReadCustomChar(4);
  685.             LCDReadCustomChar(1);
  686.  
  687.             LCD_Move(2, *pxPos);
  688.             LCDWriteData(FULL_BLOCK_PATTERN);
  689.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  690.             LCDWriteData(FULL_BLOCK_PATTERN);
  691.  
  692.             LCD_Move(3, *pxPos);
  693.             LCDWriteData(FULL_BLOCK_PATTERN);
  694.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  695.             LCDWriteData(FULL_BLOCK_PATTERN);
  696.  
  697.             LCD_Move(4, *pxPos);
  698.             LCDReadCustomChar(2);
  699.             LCDReadCustomChar(5);
  700.             LCDWriteData(FULL_BLOCK_PATTERN);
  701.             
  702.             return;
  703.         }    
  704.         else if(*pStr == 'r' || *pStr == 'R')
  705.         {
  706.             LCD_Move(1, *pxPos);
  707.             LCDReadCustomChar(4);
  708.             LCDReadCustomChar(4);
  709.             LCDReadCustomChar(1);
  710.  
  711.             LCD_Move(2, *pxPos);
  712.             LCDWriteData(FULL_BLOCK_PATTERN);
  713.             LCDReadCustomChar(0);
  714.             LCDReadCustomChar(6);
  715.  
  716.             LCD_Move(3, *pxPos);
  717.             LCDWriteData(FULL_BLOCK_PATTERN);
  718.             LCDReadCustomChar(2);
  719.             LCDReadCustomChar(7);
  720.  
  721.             LCD_Move(4, *pxPos);
  722.             LCDReadCustomChar(5);
  723.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  724.             LCDReadCustomChar(5);
  725.             
  726.             return;
  727.         }    
  728.         else if(*pStr == 's' || *pStr == 'S')
  729.         {
  730.             LCD_Move(1, *pxPos);
  731.             LCDReadCustomChar(0);
  732.             LCDReadCustomChar(4);
  733.             LCDReadCustomChar(1);
  734.  
  735.             LCD_Move(2, *pxPos);
  736.             LCDWriteData(FULL_BLOCK_PATTERN);
  737.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  738.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  739.  
  740.             LCD_Move(3, *pxPos);
  741.             LCDReadCustomChar(2);
  742.             LCDReadCustomChar(5);
  743.             LCDReadCustomChar(7);
  744.  
  745.             LCD_Move(4, *pxPos);
  746.             LCDReadCustomChar(2);
  747.             LCDReadCustomChar(5);
  748.             LCDReadCustomChar(3);
  749.             
  750.             return;
  751.         }    
  752.         else if(*pStr == 't' || *pStr == 'T')
  753.         {
  754.             LCD_Move(1, *pxPos);
  755.             LCDReadCustomChar(4);
  756.             LCDReadCustomChar(4);
  757.             LCDReadCustomChar(4);
  758.  
  759.             LCD_Move(2, *pxPos);
  760.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  761.             LCDWriteData(FULL_BLOCK_PATTERN);
  762.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  763.  
  764.             LCD_Move(3, *pxPos);
  765.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  766.             LCDWriteData(FULL_BLOCK_PATTERN);
  767.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  768.  
  769.             LCD_Move(4, *pxPos);
  770.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  771.             LCDReadCustomChar(5);
  772.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  773.             
  774.             return;
  775.         }    
  776.         else if(*pStr == 'u' || *pStr == 'U')
  777.         {
  778.             LCD_Move(1, *pxPos);
  779.             LCDReadCustomChar(4);
  780.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  781.             LCDReadCustomChar(4);
  782.  
  783.             LCD_Move(2, *pxPos);
  784.             LCDWriteData(FULL_BLOCK_PATTERN);
  785.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  786.             LCDWriteData(FULL_BLOCK_PATTERN);
  787.  
  788.             LCD_Move(3, *pxPos);
  789.             LCDWriteData(FULL_BLOCK_PATTERN);
  790.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  791.             LCDWriteData(FULL_BLOCK_PATTERN);
  792.  
  793.             LCD_Move(4, *pxPos);
  794.             LCDReadCustomChar(2);
  795.             LCDReadCustomChar(5);
  796.             LCDReadCustomChar(3);
  797.             
  798.             return;
  799.         }    
  800.         else if(*pStr == 'v' || *pStr == 'V')
  801.         {
  802.             LCD_Move(1, *pxPos);
  803.             LCDReadCustomChar(4);
  804.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  805.             LCDReadCustomChar(4);
  806.  
  807.             LCD_Move(2, *pxPos);
  808.             LCDWriteData(FULL_BLOCK_PATTERN);
  809.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  810.             LCDWriteData(FULL_BLOCK_PATTERN);
  811.  
  812.             LCD_Move(3, *pxPos);
  813.             LCDWriteData(FULL_BLOCK_PATTERN);
  814.             LCDReadCustomChar(0);
  815.             LCDReadCustomChar(6);
  816.  
  817.             LCD_Move(4, *pxPos);
  818.             LCDReadCustomChar(2);
  819.             LCDReadCustomChar(3);
  820.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  821.             
  822.             return;
  823.         }    
  824.         else if(*pStr == 'w' || *pStr == 'W')
  825.         {
  826.             LCD_Move(1, *pxPos);
  827.             LCDReadCustomChar(4);
  828.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  829.             LCDReadCustomChar(4);
  830.  
  831.             LCD_Move(2, *pxPos);
  832.             LCDWriteData(FULL_BLOCK_PATTERN);
  833.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  834.             LCDWriteData(FULL_BLOCK_PATTERN);
  835.  
  836.             LCD_Move(3, *pxPos);
  837.             LCDWriteData(FULL_BLOCK_PATTERN);
  838.             LCDWriteData(FULL_BLOCK_PATTERN);
  839.             LCDWriteData(FULL_BLOCK_PATTERN);
  840.  
  841.             LCD_Move(4, *pxPos);
  842.             LCDReadCustomChar(3);
  843.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  844.             LCDReadCustomChar(2);
  845.             
  846.             return;
  847.         }    
  848.         else if(*pStr == 'x' || *pStr == 'X')
  849.         {
  850.             LCD_Move(1, *pxPos);
  851.             LCDReadCustomChar(4);
  852.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  853.             LCDReadCustomChar(4);
  854.  
  855.             LCD_Move(2, *pxPos);
  856.             LCDWriteData(FULL_BLOCK_PATTERN);
  857.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  858.             LCDWriteData(FULL_BLOCK_PATTERN);
  859.  
  860.             LCD_Move(3, *pxPos);
  861.             LCDWriteData(FULL_BLOCK_PATTERN);
  862.             LCDWriteData(FULL_BLOCK_PATTERN);
  863.             LCDWriteData(FULL_BLOCK_PATTERN);
  864.  
  865.             LCD_Move(4, *pxPos);
  866.             LCDReadCustomChar(3);
  867.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  868.             LCDReadCustomChar(2);
  869.             
  870.             return;
  871.         }    
  872.         else if(*pStr == 'y' || *pStr == 'Y')
  873.         {
  874.             LCD_Move(1, *pxPos);
  875.             LCDReadCustomChar(4);
  876.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  877.             LCDReadCustomChar(4);
  878.  
  879.             LCD_Move(2, *pxPos);
  880.             LCDWriteData(FULL_BLOCK_PATTERN);
  881.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  882.             LCDWriteData(FULL_BLOCK_PATTERN);
  883.  
  884.             LCD_Move(3, *pxPos);
  885.             LCDWriteData(FULL_BLOCK_PATTERN);
  886.             LCDWriteData(FULL_BLOCK_PATTERN);
  887.             LCDWriteData(FULL_BLOCK_PATTERN);
  888.  
  889.             LCD_Move(4, *pxPos);
  890.             LCDReadCustomChar(3);
  891.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  892.             LCDReadCustomChar(2);
  893.             
  894.             return;
  895.         }    
  896.         else if(*pStr == 'z' || *pStr == 'Z')
  897.         {
  898.             LCD_Move(1, *pxPos);
  899.             LCDReadCustomChar(0);
  900.             LCDReadCustomChar(4);
  901.             LCDReadCustomChar(1);
  902.  
  903.             LCD_Move(2, *pxPos);
  904.             LCDWriteData(FULL_BLOCK_PATTERN);
  905.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  906.             LCDWriteData(FULL_BLOCK_PATTERN);
  907.  
  908.             LCD_Move(3, *pxPos);
  909.             LCDReadCustomChar(2);
  910.             LCDReadCustomChar(5);
  911.             LCDReadCustomChar(3);
  912.  
  913.             LCD_Move(4, *pxPos);
  914.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  915.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  916.             LCDWriteData(EMPTY_BLOCK_PATTERN);
  917.             
  918.             return;
  919.         }
  920. }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: