No announcement yet.

Genie Magic Code Read State Object

  • Filter
  • Time
  • Show
Clear All
new posts

  • Genie Magic Code Read State Object

    Only for Visi Genie Magic code, no library for arduino ...

    I have an object, a Rotaryswitch0, with 8 positions: 64, 32, 16, 8, 4, 2, 1
    If I write: WriteObject (tRotarySwitch, 0,3) the switch rotates to position 8. Perfect.
    Now, if I position the switch in another position, for example in 2, and if I want to read this data to get the data = 5 that corresponds to position 2, how do I do it?

  • #2
    this returns the uint16_t data of the object


    • #3
      I do not understand...
      I do not touch the object ... I just want to know what position it is in.
      I expect a code similar to var data = ReadObject (tRotarySwitch, 0)
      But I do not know what this code can be, I can not find anything like it.


      • #4
        if you do a readobject itll appear in your event handler, and in the event handler it's data will appear in the geteventdata function posted above, what i dont understand is you say no arduino library, but your context is referring to the library, so im confused


        • #5
          Thanks Tony
          I do not want to use Arduino, only the screen with Diablo16 and a communication with bluetooth.

          I will create a MagicEvent to go capturing all the events of the objects and I will try to use what you say to me.


          • #6
            what is the bluetooth connected to? there are 6 bytes sent from the display to the arduino, the data your looking for is in the 3rd and 4th byte. you may also use the GTX tool for assistance.


            • #7
              Solved !!! Too easy!!!
              For each object I created a MagicEvent and captured its value ...
              For example:

              func MagicEvent17(var newval)
              BLOQUE_P10_1 := newval;

              The magic code is a marvel !!!.


              • Joseph Herrera
                Joseph Herrera commented
                Editing a comment
                Hi kostas,

                You might also be interested in trying the genie Magic example that does this for the Slider Widget.
                Workshop 4 - 'File' - 'Samples' - 'Visi Genie Magic' - SliderMult

                The magic event gets the current frame of the slider and writes it to the Led Digits widget.

                Hope this helps,

            • #8
              Thanks Tony.
              I do not use the Arduino. The bluetooth module HC-08 is connected directly to the screen. The screen has the ability to digitize signals, control I / O pins and serial ports ...


              • #9
                I have the following system:
                . Display: Gen4-uLCD-32DCT-CLB
                . Workshop 4 PRO: ViSi Genie with PRO
                . Board with: gen4-PA to connect the display with extern hardware (MP3-TF-16P module to run mp3 files and the bluetooth BLE HC-08 module to communicate with a mobileā€¦)


                • #10
                  Hi kostas,

                  You could find some examples about using the serial UART functions of the displays in..

                  'File' - 'Samples' - 'Picaso Designer' - 'PICASO - Serial COMMS'

                  Maybe you could try inserting 4DGL code similiar to the example in your project using Magic.

                  Serial functions for gen4-ulcd-32DCT can be found in the Diablo16 internal functions manual:


                  Hope this helps,


                  • #11
                    Thanks Joseph and Tony
                    Your information has helped me a lot.