Announcement

Collapse
No announcement yet.

Issuing a gfx_Cls() removes decimal point when calling ledDigitsDisplay()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issuing a gfx_Cls() removes decimal point when calling ledDigitsDisplay()

    Hi,

    I am updating the screen with new text and issue a gfx_Cls() to remove unessential artifacts on the screen (uOLED-128-G2).
    However, when I do this, it removes my decimal point and must issue a media_SetAdd(iLeddigits1H, iLeddigits1L) command to get it back.

    Is there any way around this? Any comments would be appreciated. Code below.

    media_SetAdd(iLeddigits1H, iLeddigits1L) ; // point to the Leddigits1 image
    media_Image(0, 40) ; // show all digits at 0, only do this once

    txt_FGcolour(LIME) ; //Foreground Color
    gfx_MoveTo(0 , 0) ;
    txt_Opacity(1) ;

    repeat

    print("Temperature:") ;

    X1 := ABS(RAND() %1000); //random variable for display
    ledDigitsDisplay(X1, iiLeddigits1H, iiLeddigits1L, 0, 40, 3, 2, 42, 0) ;
    pause(5000);

    gfx_Cls();
    gfx_MoveTo(0 , 0) ;
    print("Windchill: ") ;

    X1 := ABS(RAND() %1000); //random variable for display
    ledDigitsDisplay(X1, iiLeddigits1H, iiLeddigits1L, 0, 40, 3, 2, 42, 0) ;
    pause(5000);

    forever

    Thanks!

  • #2
    For the example given, removing the cls and changing the second print to
    Code:
    print("Windchill:   ") ;
    Should do it, you will also need a moveto before the first print

    For more complicated 'artifact' removal you can gfx_RectangleFilled() to the background colour any areas that need erasing
    Mark

    Comment


    • #3
      Thanks, Mark.

      The alignment of empty print space helped. On the contrary, redrawing the background using the gfx_RectangleFilled() produced the same results as a gfx_Cls()-- that is. it wiped out my decimal point upon issuing an ledDigitsDisplay(). However, I went ahead and recreated my own decimal point using gfx_RectangleFilled(79,124,82,127,LIME); which works for my 3 digit/1 decimal application.

      I wanted to avoid calling media_SetAdd () and media_Image() upon updating the display variables (X1) as it redraws all digits and may be noticeable to the user.

      Regards,

      Matt

      Comment


      • #4
        There is only one layer on the display, so once something is on the display it is 'just there'. I meant to tailor the RectangleFilled so it only erases the section in question.
        Mark

        Comment

        Working...
        X