Announcement

Collapse
No announcement yet.

uOLED-160-G2 Reverse Landscape problems

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

  • uOLED-160-G2 Reverse Landscape problems

    I need some help to find out why Reverse Landscape has strange problems with the uOLED-160-V2

    I created a simple Voltmeter in Visi and it works perfectly in Landscape mode.
    I needed to put the display in the enclosure upside down as it fits better.
    When I created the code in reverse landscape mode there are 2 problems.

    1) The display keeps flashing between 000 and the correct display.
    This can be stopped by removing the line "media_Image(0, 6) ; // show all digits at 0, only do this once "

    2) The LED digits look correct but they function as if they are still in landscape mode.
    e.g. The 100's digit is 1's, the 10's digit is correct and the 1's digit is 100's

    Have I forgotten to put something in the code.

    Here it is:-

    #platform "GOLDELOX"

    #inherit "4DGL_16bitColours.fnc"

    #inherit "VisualConst.inc"

    #inherit "voltmeter1Const.inc"

    #inherit "LedDigitsDisplayGoldelox.inc"

    func main()
    var raw;
    print("Startingn") ;
    while(!media_Init())
    putstr("Drive not mounted...");
    pause(200);
    gfx_Cls();
    pause(200);
    wend

    pin_Set(ANALOGUE_10, IO1);

    repeat
    raw := pin_Read(IO1);

    gfx_Contrast(8);

    // Form1 1.0 generated 14/11/2013 11:20:40 AM

    // Leddigits1 1.0 generated 14/11/2013 12:41:25 PM
    media_SetAdd(iLeddigits1H, iLeddigits1L) ; // point to the Leddigits1 image
    gfx_Set(SCREEN_MODE,LANDSCAPE) ; // On uOLED-160-G2 videos+images only work in LANDSCAPE
    media_Image(0, 6) ; // show all digits at 0, only do this once
    ledDigitsDisplay(raw, iiLeddigits1H, iiLeddigits1L, 0, 6, 3, 2, 50, 1) ;
    gfx_Set(SCREEN_MODE,LANDSCAPE_R) ; // Restore 'operating' orientation

    pause(100) ;
    raw /= 10 ;
    forever

    endfunc



    Thanks

  • #2


    Assuming you regenerated your images and repasted your code after changing the orientation, you are almost there.

    Just change
    ledDigitsDisplay(raw, iiLeddigits1H, iiLeddigits1L, 0, 6, 3, 2, 50, 1) ;
    to
    ledDigitsDisplayD(raw, iiLeddigits1H, iiLeddigits1L, 0, 6, 3, 2, 50, 1) ;

    Sorry that the need to do that is not more obvious

    As for

    1) The display keeps flashing between 000 and the correct display.
    This can be stopped by removing the line "media_Image(0, 6) ; // show all digits at 0, only do this once "
    The 'hint' has been highlighted, you need to move that line to the initialization part of your code. Note that you will need to have more code there along with it.

    Say
    media_SetAdd(iLeddigits1H, iLeddigits1L) ; // point to the Leddigits1 image
    gfx_Set(SCREEN_MODE,LANDSCAPE) ; // On uOLED-160-G2 videos+images only work in LANDSCAPE
    media_Image(0, 6) ; // show all digits at 0, only do this once
    gfx_Set(SCREEN_MODE,LANDSCAPE_R) ; // Restore 'operating' orientation

    If that's the extent of access to the uSD in your program then the
    media_SetAdd(iLeddigits1H, iLeddigits1L) ; // point to the Leddigits1 image
    Also needs only to be done once
    Mark

    Comment


    • #3


      Hi Mark
      Excellent - that works perfectly.
      I knew it had to be something simple.

      One other thing:-
      The decimal point is missing from the digits in reverse landscape.
      It was there in landscape mode.

      Maybe I did something silly and not pasted the code correctly. I'll check it out.
      I did put a "Static Text" of a dot in between the 2 digits and it works fine.

      Thanks again for your help

      Comment


      • #4


        The decimal point is missing from the digits in reverse landscape.
        Check that the
        media_Image(0, 6) ; // show all digits at 0, only do this once
        is working correctly as that is what puts the decimal there.

        Temporarily put a
        repeat forever
        immediately after it to check
        Mark

        Comment


        • #5


          OK, It's position in the code was important.
          I had moved things around so I could understand how it worked.

          It all makes sense now.

          Thanks again for your help.

          Comment

          Working...
          X