Skip to content

ViSi: Displaying Large Integers with the LED Digit Object


The PICASO and DIABLO-16 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.


This codebase example assumes the reader can program the 4D Systems display module using Workshop4 IDE ViSi environment. Beginners are advised to read the following aplication notes.


  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.


  • 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:
#constant N_MAX 4 // we have four LED digits objects

    word uSDidx
  • Also you will need to use the function setProperties(...) for each new LED digits object. Read the comments in the code.
  1. The program should now run on the display module.


Project File