Skip to content

ViSi-Genie Magic: Arduino Button Counters


In the past it was not possible to create button counters in ViSi-Genie. With Workshop4 Pro this is now possible with the use of the magic event object. The magic event object is under the Genie Magic pane in Workshop4 Pro. It contains a 4DGL code and it can be linked to standard Genie objects such as a winbutton, such that any time that the button is touched, the magic event object is called (or the 4DGL code is executed). The magic event object may have a counter variable, the incrementing or decrementing value of which can be used to set the frame value of other objects (a LED digits object for instance). The value can also be sent to an external host. This code presents a working example of the above.


Worskhop 4 PRO is needed for this codebase example.


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


Below are the steps involved in creating this code example.

  1. Compile the attached ViSi-Genie project and upload the program to a uLCD-32PTU or any 4D Systems displays with PICASO, DIABLO-16, PIXXI-28 and PIXXI-44 graphics processors. Copy the supporting files to a uSD mounted to the PC. Properly unmount the uSD card from the PC and mount it to the display.


    • The attached ViSi-Genie project is a slightly-modified version of the UpDownRepeat example in Workshop4 Pro.
    • You will need Worskhop4 Pro for this codebase example.
  2. Compile and upload the attached sketch to an Arduino Uno. The sketch uses a software serial port for the display.

  3. Properly connect the Arduino Uno to the display. See the application notes ViSi-Genie: Connecting a 4D Display to an Arduino.

If without an Arduino host, you can still run this code example by performing step 1. Then use the GTX tool to see the report messages being sent by the display.


Project File