Announcement

Collapse
No announcement yet.

LEddigit transparent

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

  • LEddigit transparent

    Hello,
    I have a form with an image as background . I create a leddigit on the form.
    How is it possible to have a leddigit transparent background ( same as statictext ) to avoid the square around the leddigit.
    Regards
    Etienne

  • #2
    Hello Etienne,

    The LEDdigit widget has an outline color by default. You could try creating your own custom LED digit by using UserImages containing multiple digit images with transparent outline. You can check this application note for reference.

    https://www.4dsystems.com.au/appnote/4D-AN-00079/

    Best regards.

    Comment


    • #3
      Hello Jerson,
      Thanks for the reply. I agreed with your solution. In my case I have a 6 digits objet. That means , I have to create a userimages with digits from 0 to 9 with 10 différents images.
      To display the full 6 digits, I need to break down my number into 6 different number and write each after other on the display...it is ok ?? the solution will be very slow????
      Regards
      Etienne

      Comment


      • #4
        Hello Etienne,

        It's draw speed on the display would only depend on how large each digit would be and would also depend on how you update each number. Please note that the variables used in 4DGL has a maximum signed value of 32,767, so you should divide the counter to count up to 6 digits. Here's my sample code implemented for counting up to 9999.

        Code:
                input++;
                ones := input % 10;
                tens := input % 100;
                tens := tens/10;
                hundreds := countingled/100;
                if ( hundreds == 10) hundreds := 0;
                thousands := input/1000;
        
            img_SetWord(hndl, iUserImage1, IMAGE_INDEX, ones) ; // where frame is 0 to 9
            img_SetWord(hndl, iUserImage2, IMAGE_INDEX, tens) ; // where frame is 0 to 9
            img_SetWord(hndl, iUserImage3, IMAGE_INDEX, hundreds) ; // where frame is 0 to 9
            img_SetWord(hndl, iUserImage4, IMAGE_INDEX, thousands) ; // where frame is 0 to 9
            
            img_Show(hndl,iUserImage1) ;   // Show One place
            img_Show(hndl,iUserImage2) ;   // Show Ten place
            img_Show(hndl,iUserImage3) ;   // Show Hundred place
            img_Show(hndl,iUserImage4) ;   // Show Thousand place

        Comment


        • #5
          Ok Jerson for the code.
          At present time, I am using an Arduino to count and the result is split into 2 variables, the first one is loaded on the 4 digits right and the second variable goes to the 2 digits left.
          Your code should be included in my Arduino software or compiled on the SDcard???
          I am reading a lot of your Appnote concerning 4DGL code, but it is not always very clear for me how to use it and how to compile.
          Regards
          Etienne

          Comment


          • #6
            Hello Etienne,

            The sample code is for use with the ViSi environment of the Workshop4, so there is no need to include this code for the display part since you are already working with ViSi-genie. You could apply and improve the computation part, the first seven lines of the code, for the Arduino software (the purpose of the code is for updating a variable for the frames of each Userimage). You would need to update each UserImage widget depending on what your final output should be, as it work differently from the LEDdigit widget.

            Comment


            • #7
              Hi Jerson,
              Yes, I am working in this way.
              By the way as I am working with Arduino components, could you tell me if there is a good explanation (appnote) of how to use the code generated by a magic object in a Arduino sketch or do I need just to compile the code into the SDcard. This is not very clear for me how to use the Magicobject, or Magicevents codes...
              Thanks for the replay.
              Regards
              Etienne

              Comment


              • #8
                Hello Etienne,

                There are lots of application notes for Magic objects. The Magic codes are programmed into the display itself as you upload the project. The magic objects allow insertion of 4DGL codes, available only in the ViSi environment, to be added to the ViSi-genie project which will enhance the capabilities of your projects. You could start with this application note about the different magic objects and their use:

                https://www.4dsystems.com.au/downloa...182_R_1_01.pdf

                Best Regards

                Comment


                • #9
                  Hi Jerson,
                  I have already checked this appnote and I will restart from the beginning and learn step by step...
                  Have a nice day.
                  Etienne

                  Comment


                  • #10
                    Hello,
                    To solve my problem of 6 digits display with transparent background, I have created a Smartgauge0 with 4 digits and with format 0.000 and another Smartgauge1 with 2 digits and format 00.
                    In the Smart digit editor, for Smartgauge0, on layer1 , I put min/max value to 9999, I have 10000 frames for this digit
                    Click image for larger version

Name:	Capture d’écran 2018-03-04 à 19.54.38.png
Views:	58
Size:	842 Bytes
ID:	62281

                    and for the numeric part I have this

                    Click image for larger version

Name:	Capture d’écran 2018-03-04 à 19.54.50.png
Views:	49
Size:	4.0 KB
ID:	62282

                    for Smartgauge1, I have the followings: 100 frames for this digit

                    Click image for larger version

Name:	Capture d’écran 2018-03-04 à 20.02.33.png
Views:	50
Size:	1.6 KB
ID:	62283

                    and for the numeric part

                    Click image for larger version

Name:	Capture d’écran 2018-03-04 à 20.02.41.png
Views:	50
Size:	5.3 KB
ID:	62284
                    In addition I have created a frame with photoshop and here is the final result, a 6 digits display with transparent background
                    Click image for larger version

Name:	Capture d’écran 2018-03-04 à 19.55.05.png
Views:	48
Size:	40.3 KB
ID:	62285
                    In my Arduino, I have a simple code , I have a counter and I cut the time in 2 values tecoul1 and tecoul2
                    tecoul1 is for the 0.000 digits and tecoul2 is for 00 digits
                    genie.WriteObject(GENIE_OBJ_ISMARTGAUGE, 6, tecoul1);
                    genie.WriteObject(GENIE_OBJ_ISMARTGAUGE, 2, tecoul2);
                    If I use only this 6 digits it work very fine on my ULCD-70DCT. Now another Smartgauge is added like this one with 100 frames, displaying the humidity from a sensor.

                    and another Smartgauge displaying the battery voltage. with 500 frames

                    All Smartgauge used one by one are working fine, but when they are all loaded into my screen, the screen is working very slowly and not responding to the Arduino commands...
                    To test that I have included a Winbutton on my screen and when I push the button, it takes more than 5 seconds before the Arduino receive the command from the button.
                    Any idea about this problem?????
                    regards
                    Etienne

                    Comment


                    • #11
                      Here are the other Smartgauges, only 5 pictures allowed in a post...
                      humidity sensor

                      Click image for larger version

Name:	Capture d’écran 2018-03-04 à 20.25.53.png
Views:	52
Size:	6.7 KB
ID:	62287
                      battery voltmeter
                      Click image for larger version

Name:	Capture d’écran 2018-03-04 à 20.26.33.png
Views:	49
Size:	37.4 KB
ID:	62288

                      regards
                      Etienne

                      Comment


                      • #12
                        Hello Etienne,

                        Maybe the slow response is from how you are updating the objects in Arduino, you could try a higher Baud rate when you are updating the Gauges more frequently.

                        Best regards,

                        Comment


                        • #13
                          Hi Jerson,
                          Thanks for the answer. the baud rate between Arduino and screen is at 115200. I do not think that the baud rate is the problem.
                          I load all gauges on the uSD card and when the program start, after the reset and the Arduino setup, on the screen I can just see the gauge frame the digits 000.000 are not displayed.
                          On the screen I have a button for test, when the button is pressed, it takes around 5 sec to be detected in the genie.DoEvents(); routine.
                          If I load on the uSD card only one gauge and test separately, every gauge is working fine. I think that the problem is linked to the number of gauges and frames, but I can't not see why???
                          Regards
                          Etienne

                          Comment


                          • #14
                            Hi Jerson, I have discovered the source of my problem....the delay to reset the display was too short....I have increase the delay from 3500ms to 4200ms and now all gauges are working fine...It is strange for me because it seems that the reset time is linked to the size of the software inside de uSD????. By the way I have another small problem. I have my gauges with a transparent frame and a static text with transparent option.
                            On the project I have the following design.

                            Click image for larger version

Name:	Capture d’écran 2018-03-05 à 20.57.30.png
Views:	45
Size:	37.1 KB
ID:	62305

                            and on the display I have this

                            Both static texts are not displayed...could you tell me how to achieve that???
                            Best regards
                            Etienne

                            Comment


                            • #15
                              Hello Etienne,

                              The delay is required for the display to wait for the program handling the images in your uSD card to initialize. It seems that your second image in your post is broken so I can't see whats in there, static texts re treated as an image in the display so maybe its being overlapped by a larger image in the display.

                              Best regards.

                              Comment

                              Working...
                              X