Announcement

Collapse
No announcement yet.

4D-CD-00006 Genie Magic - Button Counters - Arduino

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

  • 4D-CD-00006 Genie Magic - Button Counters - Arduino

    In the past it was not possible to create button counters in ViSi-Genie. With Workshop 4 Pro this is now possible with the use of the magic event object. The magic event object is under the Genie Magic pane in Workshop 4 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.



    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. 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 ViSi-Genie project is a slightly-modified version of the UpDownRepeat example in Workshop 4 Pro.

    Note 1.B: You will need Worskhop 4 Pro for this code 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 uLCD-32PTU. See the application notes for this.


    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.
    Attached Files
    Last edited by Doff; 7th April 2015, 12:47 PM.
    Doff
Working...
X