No announcement yet.

Screen Saver

  • Filter
  • Time
  • Show
Clear All
new posts

  • Screen Saver

    I am using an arduino mega 2560 r3 along with a uLCD-70DT. I am not using the shield but wiring the uLCD directly to the arduino. I would like to make a screen saver so that after 5 minutes of no touch activity on Form 0, the screen switches to Form 1. At anytime after the switch to Form 1 if you touch the screen, it switches back to Form 0. Is there a way to do this?

    Last edited by mpo881; 9 December 2015, 07:08 AM.

  • #2
    You would normally detect the lack of activity in the Arduino, set contrast to 0 and the form to form1. Form 1 would just be a huge button, but the user would never see this as the display would be off. When they button is pressed the arduino would switch back to form0 and set contrast to non 0 to turn on the backlight.

    The contrast (backlight) setting does not change the detectability of touch.


    • #3

      Perhaps this codebase example might help:

      4D-CD-00008 Genie - Screen Saver - Arduino

      When not using the adaptor shield for the display module, you will have to reverse the reset logic in the setup( ) function of the sketch. Also, since the uLCD-70DT is a large display, the Arduino Mega may not be able to power it. For more details, kindly read the application note

      ViSi-Genie Connecting a 4D Display to an Arduino Host

      Particularly section "Reset the Arduino Host and the Display" on pages 22 and 23 and section "Power the Arduino Host and the Display Separately" on page 32.

      Hope the above helps and regards.


      • #4
        Thanks both for your reply. I will read the suggested material and get to work.


        • #5
          Having difficulty downloading code referenced in this thread.

          4D-CD-00008 Genie - Screen Saver - Arduino



          • James_4DSystems
            James_4DSystems commented
            Editing a comment
            Works fine for me Bill.
            Make sure you are logged into the forum, go to that page and refresh your browser, and try and download again.
            If that doesnt work, click the download, you may get a white screen, then press refresh.
            This can happen when your browser caches the page if you looked at it when you were not logged in to the forum

        • #6
          mpo881: I wrote up an idea just for you

          unsigned long screenSaverTimeout = millis();
          bool screenSaverCheck; // to check, or not to check? that is the question!
          void loop() {
            if ( screenSaverTimeout - millis() >= 300000 && screenSaverCheck == 1 ) { // if over 5 minutes and monitoring...
              screenSaverCheck = 0; // we can stop looking at the timer now, goto sleep!
              genie.WriteObject(GENIE_OBJ_FORM, 0x01 , 0); // activate form1 (blank screensaver page? where did it go!?)
              genie.WriteContrast(0); // turn off backlight (*whispers* I can see dead people...)
          void myGenieEventHandler(void) {
            genieFrame Event;
            screenSaverTimeout = millis(); // always keeps 5 minute clock reset on every event
            if ( !screenSaverCheck ) {  // looks like we're asleep during an event, (who touched me!?)  lets get the lcd online! (one shot trigger)
              genie.WriteObject(GENIE_OBJ_FORM, 0x00 , 0); // activate form0 (wake up now or else!)
              genie.WriteContrast(15); // turn on backlight, beware nocturnal coders...
           screenSaverCheck = 1; // enable sleep timer
          Last edited by tonton81; 11 January 2017, 07:54 AM.


          • mpo881
            mpo881 commented
            Editing a comment
            Thanks very much. I appreciate that!

        • #7
          Doesn't the event handler get called regardless of events, wouldn't you to place the instance of writing contrast back up to after the first conditional?