Announcement

Collapse
No announcement yet.

Dim backlight uLCD-43DCT

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

  • Dim backlight uLCD-43DCT

    Hi.
    Im new on 4Dsystems LCD displays.
    Playing around with a uLCD-43DCT trying to make a digital lectrical switchboard for my home using ViSi Genie.
    I created an extra Form "Form1" to use it as "Setup Options Menu"
    On that Form i added a 'Slider" and i cant found how i can use this to Dim the display backlight.
    Any ideas how i can do this????

  • #2
    Good day!

    First set your input widget to send a message from display to your host controller, in your Workshop 4 in your Visi Genie environment under the object inspector click events -> On changed -> Report message. Please see the picture below:

    ​​​​​

    You can receive the report and use it when updating the contrast/brightness of the display.

    We provide some libraries which makes it easier to handle the communication between the display and the host controller. Please refer to this article regarding where to find these resources.

    You might be interested in WriteContrast commands from these libraries. Feel free to browse the examples to find anything else you need.


    Hope this helps

    Best regards

    Comment


    • #3
      Graphically i can do the "under the object inspector click events -> On changed -> Report message" thing, but to includethe library, needs to code, and there is no such function on ViSi Genie, only on other modes of Workshop.
      Do you havyou Code example?

      Comment


      • #4
        Hello,

        Can I ask if your digital switchboard setup involves a host controller? Or are you using the display only (Diablo16)? I think Sep believes you are using a host controller, hence why he is suggesting the 'Report Message' event and library usage. If this is true, let me know and I will go into detail on how to make it work.

        However if I am correct in believing you are using the display as the host, unfortunately there is no way to do what you are asking in ViSi-Genie. As you know, there is no code in ViSi-Genie, so we cannot code the slider to control the screen brightness. Although, if you have ViSi-Genie Magic, it is very easy. Simply create a magic event with the code gfx_Contrast(newval); and attach the event to the slider.

        If you don't have Workshop4 Pro, you can use the gfx_Contrast function in a similar way in ViSi, however, you will have to recreate your project in ViSi for this method.

        Let me know if you are using a host controller and I will expand on what Sep brought up. Otherwise, if you need more explanation on one of the other methods I suggested please feel free to ask any questions.

        I wish you a Happy New Year,
        Adem

        Comment


        • DrVarnick
          DrVarnick commented
          Editing a comment
          you are right, im using only the display Diabolo16.
          I manage to "Save As" as "ViSi" and not as "ViSi Genie"
          So, if you can show me an example of code under the Widget "Slider1" of how to do that will be great

      • #5
        Hi again,

        If you would like 'Slider1' to control the brightness of the display, first make sure that the max value is set to 15. Then, if you have converted a ViSi-Genie project to ViSi through 'Save As', go to the UpdateObjects function, and where you see 'WriteObject(GObejectType, GObjectIndex, newval)' put this code underneath:

        Code:
        if(GObjectType == tiSliderE && GObjectIdx == 1) //If you are using a different slider with different index, make sure to change this line to reflect your slider
        gfx_Contrast(newval);
        endif
        I have attached a sample project demonstrating this code working, the lines I have implemented are 387-389, so hopefully you should get an understanding of how it works. I would recommend you recreate your project in ViSi rather than to use 'Save As' as it will be much easier to add/modify code to a new ViSi project than it is to add/modify code to a generated project.
        Attached Files
        Last edited by ademdeojee; 3 days ago.

        Comment

        Working...
        X