Announcement

Collapse
No announcement yet.

System Function

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

  • System Function

    35DCT-CLB

    How and Where to insert Deep Sleep function?


    Thank you

  • #2
    Hello,

    You can find information about deep sleep on page 293 of this datasheet. http://www.4dsystems.com.au/productp...ons_R_1_16.pdf

    If you are using Visi-Genie and Magic code it should be placed in Mainloop code or in Visi or designer in your repeat forevor loop.

    I hope this helps.

    Best regards

    Paul

    Comment


    • #3
      Thank you sir.

      I will try. I appreciate your help

      Comment


      • #4
        Hi,

        I tried to put the screen in deepsleep mode by creating a magic event in Genie. However, If I touch the screen while in deelsleep mode, the screen wakes up, but the serial communication sometimes goes wrong. Nothing works after this, and have to restart the whole system. I am using uLCD-50 DCT screen in my project. Would you please suggest me something on it.

        Here is my magic event function.


        func MagicEvent0(var newval)
        var i := 10;
        var t := 0;
        while(i > 0)
        i--;
        gfx_Contrast(i);
        pause(20);
        wend
        if (i == 0)
        ActivateForm(10) ;
        while(t == 0)
        t := sys_DeepSleep(65535);
        wend
        pause(20);
        disp_Init();
        pause(20);
        gfx_Contrast(10);
        ActivateForm(0);
        pause(20);
        else
        print("can not sleep");
        endif
        endfunc

        Comment


        • #5
          Hello,

          Can you let me know if you are you using an Arduino as your host ?

          Best regards

          Paul

          Comment


          • #6
            Hi,

            Yes, I am using arduino due board in my project.

            Comment


            • #7
              Hi,

              There is a new version of genieArduino here https://github.com/4dsystems/ViSi-Ge...o-Library-BETA which has better support for the DUE which may solve your problem. It is possible that your Magic Event for Deep Sleep is going to send an Ack when finished and the Arduino will sit waiting for it but as the display is in sleep mode it is not going to send the Ack until coming out of sleep.

              Best regards

              Paul

              Comment


              • #8
                Hi Paul

                Thanks for providing the new libraries. It worked good; however, I came across one issue with my code which was running well with old libraries. Once, I program the Due board, the screen should show the login form, which is default form I have set up in the workshop IDE. If Due board resets for any reason, the screen should show the confirmation form that has yes or no option to resume program after reset. However, the program control comes to change the form, but the form does not change on the screen. I am using the following command to change the form with new libraries that you have provided above.
                genie.WriteObject(GENIE_OBJ_FORM,0x01,0);

                Do I need to do something in Arduino setup code for touchscreen? I have a reset logic in the setup code.
                Serial1.begin(115200);
                genie.Begin(Serial1);
                //Serial.begin(460800);
                Serial.begin(115200);
                while (!Serial) {

                //SysCall::yield();
                ;
                }
                delay(1000);
                digitalWrite(RESETLINE, 1);
                delay(100);
                digitalWrite(RESETLINE, 0);
                delay(3000);

                Comment


                • #9
                  you dont need to do resetline code with new library, it syncs automagically, leaving the form in the last place it was after resetting the duo, and still able to access the widgets after duo boots without loosing track

                  im not entirely clear on the question, the new library is able to detect and send an event when the lcd is connected or disconnected, you could have the "connected" event trigger your login form whenever the screen "syncs" to the mcu (like when you reset the Duo, or hotplug it's lines, or power off and on just the lcd

                  you may also change form using the new function as well
                  genie.form(1);
                  Last edited by tonton81; 21st September 2017, 07:22 AM.

                  Comment

                  Working...
                  X