Announcement

Collapse
No announcement yet.

uLCD-70DT lights up, but its blank.

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

  • uLCD-70DT lights up, but its blank.

    myWork.zip
    I m new to this so I can't figure out what the problem is.
    Here is my procedure:
    After creating a new file and selecting my display, I choose Visi.
    I placed a button(4dButton01) anywhere on the screen.
    In the "Object" drop down menu, selected "Form1".
    Pasted the code above "gfx_Set(SCREEN_MODE,LANDSCAPE); "
    Changed the "on" to "1" because it was showing error in the line "img_SetWord(hndl, i4Dbutton1, IMAGE_INDEX, on); " (line 37)
    Inserted my memory card (2GB) in the computer and formatted it with FAT16.
    Compiled my program with zero errors to the memory card.
    Memory card has 2 files in it now: myWork.dat & myWork.gci
    Remove the memory card from computer and inserted it in the uLCD-70DT display.
    Connect the display to the computer.
    Select the comm (COM38).
    Click "Download" from the "Home" menu.
    Computer open a small window that says "downloading program" real quick and then disappears.
    The uLCD-70DT display says:
    Filename myWork.4xe
    Saving to RAM
    Buffering
    for less than a second and the disappears.
    Then the screen lights up but remains blank.

    What am I doing wrong?

    Here is my code:
    Code:
    #platform "uLCD-70DT"
    
    // Program Skeleton 1.2 generated 18-Mar-17 12:20:24
    
    #inherit "4DGL_16bitColours.fnc"
    
    #inherit "VisualConst.inc"
    
    #inherit "exp2Const.inc"
    
    func main()
    //  var hstrings ; // Handle to access uSD strings, uncomment if required
    //  var hFontx ;   // Handle to access uSD fonts, uncomment if required and change n to font number
    //  Uncomment the following if uSD images, fonts or strings used.
    /*
        putstr("Mounting...\n");
        if (!(file_Mount()))
            while(!(file_Mount()))
                putstr("Drive not mounted...");
                pause(200);
                gfx_Cls();
                pause(200);
            wend
        endif
    //    gfx_TransparentColour(0x0020);    // uncomment if transparency required
    //    gfx_Transparency(ON);             // uncomment if transparency required
    
    //  hFontn := file_LoadImageControl("exp2.dan", "exp2.gcn", 1); // Open handle to access uSD fonts, uncomment if required and change n to font number dropping a and c if > 9
    //  hstrings := file_Open("exp2.txf", 'r') ; // Open handle to access uSD strings, uncomment if required
        hndl := file_LoadImageControl("exp2.dat", "exp2.gci", 1);
    */
    
    
        // 4Dbutton1 1.0 generated 18-Mar-17 12:25:57
        img_ClearAttributes(hndl, i4Dbutton1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
        img_Show(hndl, i4Dbutton1);  // show button, only do this once
        img_SetWord(hndl, i4Dbutton1, IMAGE_INDEX, 1); // where state is 0 for up and 1 for down
        img_Show(hndl,i4Dbutton1) ;
    
        gfx_Set(SCREEN_MODE,LANDSCAPE) ;
    
        repeat
        forever
    endfunc
    Last edited by Something; 20th March 2017, 02:37 PM.

  • #2
    i couldnt get it to compile, you need the adjacent files to go with it. please use the "Zip Project" in the file menu whenever you want to post your project
    Tony

    Comment


  • #3
    What happens if you read the comments and uncomment the bits it says to uncomment?

    Also, have a look at some of the examples, file, samples, Picaso ViSi, 4D Button
    Mark

    Comment


    • Something
      Something commented
      Editing a comment
      Thank you so much! It worked. I only uncommented the if-loop. I don't why it worked though. That loop only prints if the drive is mounted or not.

  • #4
    Hi Something,

    You can check the 'Return' Status of the function 'file_Mount()' in the Diablo16 Internal Functions:
    (On page 339)
    http://www.4dsystems.com.au/productp...ons_R_1_16.pdf

    That function is used first when using File/SD card functions. Including the images used to display the wdigets.

    Hope this helps,,

    Comment

    Working...
    X