Announcement

Collapse
No announcement yet.

iButtonD colorchange from program

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

  • iButtonD colorchange from program

    Hi,
    About the IButtonD
    I need to change the color of the rings in the pushbottom.

    When my application status is normal, the ring should be Green, in case the user need to press the button, the rings should change to Red.

    Is it possible? I have looked through many of your documents but not found any way to do that.

    Thanks in advance
    Poul



  • #2
    Hi Poul_Thomsen,

    You may modify the looks of your IButtonD by going to the Object Inspector of your IButtonD object.
    To set the Color of the rings, you simply need to set the RingColorOff to GREEN and RingColorOn to RED.

    Click image for larger version

Name:	IButtonD1.png
Views:	121
Size:	62.4 KB
ID:	74876

    Hope this helps and Best Regards,
    Eran
    Eran

    Comment


    • #3
      Thanks Eran,

      But I want to change the clor form my code:

      If tanklevel is high then IbuttonD.ring.color = red; // something like that.

      Is it possible?

      thanks in advance
      Poul


      Comment


      • #4
        Hi Poul_Thomsen,

        When you click the "Paste Code" and compile the program, it automatically generates the IButton Data Properties that you have set in the Object Inspector, thus setting the Red/Green Ring colors.

        I have attached a sample code with an IButtonD that changes Ring Colors. Please check this sample program and see if this can help your project.

        Hope this helps and Best Regards,
        Attached Files
        Eran

        Comment


        • #5
          Thanks again.

          Can you make your example in Visi Genie, as that is the one I want to use for this project?

          br
          Poul

          Comment


          • #6
            Hi Poul,

            Please see attached file for the sample code in ViSi-Genie. This sample code changes the color of the Rings when the IButtonD is pressed.

            I should mention though that in ViSi-Genie, there is no coding needed to change the ring colors. You only need to set the RingColorOff/RingColorOn properties.
            If you are using an external host, you just need to send a command that will set the iButtonD's state to 1 if you want to change it to red; and set the state to 0 if you want to turn it back to green.

            Hope this helps and Best Regards,
            Attached Files
            Eran

            Comment


            • #7
              Hi Eran, I am sorry, we are on 2 different planets here.

              I general:
              Many off your application notes are directed towards users of external host.

              Unfortunately, I am not one of them, so I have to find a way to do the same things within the display.

              I understand now, that it is not possible to change the ringcolors from the program code in Visi Genie.

              As per your former example it is apparently only possible via Visi.

              Anyway, thanks for your assistance.

              Best regards
              Poul







              Comment


              • #8
                Hi Poul,

                Apologies for the confusion.

                To clarify: with ViSi-Genie, there is no coding required since the code is done by the display itself, but it is still possible to add a code in ViSi-Genie using the ViSi-Genie Magic environment (available in Workshop4 Pro).

                With this, I have attached a sample code for you to try on that is written in ViSi-Genie Magic.
                This is the same code that I have used to write in ViSi environment that I have shown you before.

                Hope this helps and Best Regards,
                Eran
                Attached Files
                Eran

                Comment


                • #9
                  Hi Eran,

                  Thanks a lot, I see how it is done now.


                  This code:
                  // IButtonD1 Data Start
                  word IIButtonD1 28, 24, 50, 0x9CD3, 0x5ACB, 0x70, GREEN, RED, 0xAD55,
                  0x39E7, 0x20, 0x40, 0x6B6D, CIButtonD1, MAROON, RED, 3, 1
                  byte CIButtonD1 "IButtonD1",0
                  // IButtonD1 Data End

                  I can paste the code in Visie and reuse in Genie but;

                  Is there a way I can find it directly in Genie?

                  regards
                  Poul



                  Comment


                  • #10
                    Hi Poul,

                    That's great to hear.
                    As of now, that is the easiest way to add the code in ViSi-Genie Magic.

                    Hope this helps and Best Regards,
                    Eran

                    Comment


                    • #11
                      Thanks for assistance.

                      Comment

                      Working...
                      X