ViSi-Genie Magic: Arduino Button Counters
Introduction
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.
Note
Worskhop 4 PRO is needed for this codebase example.
Prerequisites
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.
- ViSi-Genie: Getting Started with PICASO Displays
- ViSi-Genie: Getting Started with DIABLO-16 Displays
- ViSi-Genie: Getting Started with PIXXI Displays
- ViSi-Genie: Connecting a 4D Display to an Arduino
Instructions
Below are the steps involved in creating this code example.
-
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.
Note
- 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.
-
Compile and upload the attached sketch to an Arduino Uno. The sketch uses a software serial port for the display.
-
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.