SLAAEO3 September 2024 MSPM0L2227 , MSPM0L2228
Creating a look-up table containing
commonly displayed data, such as numbers, characters, or symbols, makes code easier
to read. For example, if numbers are displayed on the LCD, create a look-up table
containing the values to write into the LCD memory registers to display each digits
0-9. Using the look-up table in the code snippet below, a write to display a digit
looks like: DL_LCD_writeMemory(LCD, memIdx, displayData);
//lookup table for digits on LP-MSPM0L2228 segmented LCD
const char digit[10][4] = {
{0x07, 0x09, 0x08, 0x0A}, /* "0" LCD segments a+b+c+d+e+f+k+q */
{0x00, 0x00, 0x00, 0x0A}, /* "1" */
{0x03, 0x0A, 0x00, 0x0C}, /* "2" */
{0x01, 0x0A, 0x00, 0x0E}, /* "3" */
{0x04, 0x02, 0x00, 0x0E}, /* "4" */
{0x05, 0x0A, 0x01, 0x00}, /* "5" */
{0x07, 0x0A, 0x00, 0x06}, /* "6" */
{0x00, 0x08, 0x00, 0x0A}, /* "7" */
{0x07, 0x0A, 0x00, 0x0E}, /* "8" */
{0x05, 0x0A, 0x00, 0x0E} /* "9" */
};
DL_LCD_writeMemory(LCD, memIdx, displayData);