Other way to clear text with GLCD_write_text_Adv?

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
gluipy
Posts: 12
Joined: 23 Oct 2010 15:41
Location: Netherlands, Arnhem

Other way to clear text with GLCD_write_text_Adv?

#1 Post by gluipy » 24 Mar 2015 16:51

Hi All,

I'm experimenting with Fontcreator and GLCD
Works fine, but when i updating text on the GLCD, the whole display is updating en flickering when i use the Glcd_Fill(0x00) command.
Now i have an other method by inverting the changing text position before writing a new one.
Because i use a created font, i understand that i have to use the Glcd_Set_Font_Adv and Glcd_Write_Text_Adv command.

This is my code:

Code: Select all

  

main:
  anselh = 0x00                                      ' turn off analog inputs
  ansel  = 0x00
  Glcd_Init()                                        ' Initialize Glcd
  Glcd_Fill(0x00)                                    ' Clear Glcd
  Glcd_Set_Font_Adv(@Arial_Bolt_11, 1, 0)            ' Change font
  Glcd_Write_Text_Adv("MOTOR UP:", 0, 0)            'unchangeable text

  while TRUE

    ByteToStr(TEST, TEST_Conv)                       ' Convert variable for displaying
    Glcd_Write_Text_Adv(Test_Conv, 95, 0)            ' Write value on  x and y position
    Inc (TEST)                                       ' increment value by 1
    Delay_ms(700)                                    ' pause
    
    'Inverting text to clear
    Glcd_Set_Font_Adv(@Arial_Bolt_11, 0, 0)          ' Invert screen on position
    Glcd_Write_Text_Adv(Test_Conv, 95, 0)            ' Write inverted tekst (empty)
    Glcd_Set_Font_Adv(@Arial_Bolt_11, 1, 0)          ' Set to normal mode

  wend
end.
My Question:

Has some one a nice or shorter method to do this?

regards,

Christian

User avatar
Aleksandar.Mitrovic
mikroElektronika team
Posts: 1697
Joined: 11 Mar 2015 12:48

Re: Other way to clear text with GLCD_write_text_Adv?

#2 Post by Aleksandar.Mitrovic » 31 Mar 2015 18:35

Hi Christian,

This is quite short example which you make.

I can also suggest you to try with a square field on desired part of the screen instead of writing inverted text again.
That will probably make your code to work faster.

Best regards,
Aleksandar

Post Reply

Return to “mikroBasic PRO for PIC General”