This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to perform OLED Line clear in Stellaris LM4F232H5QD !!!

Hello Friends

I have written a string in OLED at (2,5) coordinates using SSI, now I need to rewrite another string in the same coordinate. But both strings are overlapping.Can anybody suggest me how to clear a particular line !??? So that i can wait for few seconds after first string write and then clear it, which enables me to write another string.!!! I tried with the GrFlush(&sContext);, but dint worked :( :/

Below is the code chunk i am following....

void main(void)

{

//Oled initialization code

Display();

}

void Display(void)
{

GrContextInit(&sContext, &g_sCFAL96x64x16);
GrContextForegroundSet(&sContext, ClrWhite);
GrContextFontSet(&sContext, g_pFontCm12);

GrStringDraw(&sContext, "Hello", -1,2,25, 0);

//How to Clear the above string, So that I can display "Stellaris"

GrStringDraw(&sContext, "Stellaris", -1,2,25, 0);


}

 

  • Hi,

    You must have the follwing sequence:

    GrStringDraw(&sContext, "Hello",  -1, 2, 25, 0);

    // some delay, ~ 100 mS

    GrStringDraw(&sContext, "    ", -1, 2, 25, 0); // four spaces instead Hello

    Generally, you must define the message to be printed outside the function and to have a blank message defined also so to just repeat the command but with the blank message as parameter.

  • Hello Petrei

    I tried with Spaces, but I found both the string and spaces are overlapping instead of just spaces.

    So I thought of clearing the particular line by filling it with black and then rewriting the string in the same location . it is working fine now. but does it impact in any other way???Need your suggestion.

    void ClrScreen()
    {
    sRect.sXMin = 0;
    sRect.sYMin = 60;
    sRect.sXMax = 96;
    sRect.sYMax = 50;
    GrContextForegroundSet(&sContext, ClrBlack);
    GrRectFill(&sContext, &sRect);
    GrFlush(&sContext);
    }

    main()

    {

    GrStringDraw(&sContext, "Hello",  -1, 2,49, 0);

    // delay and screen clear

    SysCtlDelay(SysCtlClockGet());
    ClrScreen();

    GrStringDraw(&sContext, " Stellaris ", -1, 2, 49, 0); /

    }

  • Also y cant we use GrFlush and DpyFlush!!! Is these are only related to OLED buffer flush? OR where we can use these functions, because it dint worked out for me , when i tried for line clearing operation.