Announcement

Collapse
No announcement yet.

4D-CD-00036 ViSi Displaying Large Integers with the LED Digit Object

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 4D-CD-00036 ViSi Displaying Large Integers with the LED Digit Object

    The Picaso and Diablo16 are 16-bit processors, and signed number operation with 16-bit integers limits the maximum number that can be displayed by LED digits objects to "32,767". 2^16 equals 65,536. Divide this by two since the first half is used to represent positive numbers; the remaining half is used to represent negative numbers. Thus, attempting to create a 6-digit LED digits object or to make a LED digits object display a value beyond the limit results to red "X" marks on the object during runtime. To be able to display a value higher than "32,767" in ViSi, one solution is to use the string format specifiers of 4DGL strings. This is in combination with the 4DGL math functions for operating on 32bit integers.

    Instructions:

    1. Compile the attached ViSi project and upload it to a uLCD-32PTU (or your target display). Copy the supporting files to a uSD mounted to the PC. Properly unmount the uSD card from the PC and mount it to the uLCD-32PTU.

    Note 1.A: The attached project has two LED digits objects. If you intend to add more LED digits objects to the project, you need to edit the constant "N_MAX" and the data block "uSDidx". If you add two LEd digits objects to the project for instance, then you would write:

    Code:
        #constant N_MAX 4 // we have four LED digits objects
    
        #DATA
            word uSDidx
            iiLeddigits0,
            iiLeddigits1,
            iiLeddigits2,
            iiLeddigits3
        #END
    Note 1.B: Also you will need to use the function "setProperties(...)" for each new LED digits object. Read the comments in the code.

    2. The program should now run on the display module.



    Attached Files
    Doff
Working...
X