Announcement

Collapse
No announcement yet.

Keyboard Object Question

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keyboard Object Question

    Hi All

    Sorry if this is a dumb newbie question (attempting my first project!)

    So what I am trying to do is construct a message that has two parts (its a midi message) such that it can eventually be sent to my Arduino.

    What I'd like my user to do is touch select one of two three digit 'string' objects and then via a cellphone style keyboard object enter some numeric data to the last selected string object.

    I'd then like an 'enter' button which looks at the contents of the two string objects and constructs a message containing the two values and sends it out to my Arduino.

    Can this be done in a visi-genie project. So far as far as I can see, the keyboard objects cannot update string objects directly in a visi-genie project so I'm guessing the answer is no and I'll have to do is in code as a visi project?

    Any help to avoid me going down a rabbit hole would be much appreciated.

    Thanks

    Tim


  • #2
    Hello Tim,

    Welcome to the forum!

    Visi-Genie allows the communication between the display and the Arduino. Using the standard means for your project, it is not possible to implement the features that you want to achieve. This is because in Visi-Genie environment, the string widget can't be 'touched'.

    However, utilizing the other widgets in the environment can make your project possible. The technique would be putting a userbutton on 'top' of the string object and allow the userbutton to send "report message" message to the Arduino. The Arduino should then interpret the message and send a genie.WriteStr command back to the corresponding string to show the pressed-in values. All other algorithms should all then be handled by the Arduino in conjunction with the display's "report message" events. In this setup, whenever the userbutton is pressed while the string object has a stored value, the string will also be cleared and you can start pressing-in the value once again. (You may try the attached example as reference)

    Another means of implementing your project is using the Magic codes(Available in the pro version). You mentioned that you don't want "going down a rabbit hole", but your project could be implemented much easier using this option. This method will allow you to put a code in your Visi-Genie environment that will detect if the region containing the string object is pressed and perform additional routines. Also using ViSi-Genie magic can help you reduce cost by eliminating the use for a host controller.

    Hope it helps and Regards,

    Eran
    Attached Files
    Eran

    Comment


    • #3
      Originally posted by Eran View Post
      Hello Tim,

      Welcome to the forum!

      Visi-Genie allows the communication between the display and the Arduino. Using the standard means for your project, it is not possible to implement the features that you want to achieve. This is because in Visi-Genie environment, the string widget can't be 'touched'.

      However, utilizing the other widgets in the environment can make your project possible. The technique would be putting a userbutton on 'top' of the string object and allow the userbutton to send "report message" message to the Arduino. The Arduino should then interpret the message and send a genie.WriteStr command back to the corresponding string to show the pressed-in values. All other algorithms should all then be handled by the Arduino in conjunction with the display's "report message" events. In this setup, whenever the userbutton is pressed while the string object has a stored value, the string will also be cleared and you can start pressing-in the value once again. (You may try the attached example as reference)

      Another means of implementing your project is using the Magic codes(Available in the pro version). You mentioned that you don't want "going down a rabbit hole", but your project could be implemented much easier using this option. This method will allow you to put a code in your Visi-Genie environment that will detect if the region containing the string object is pressed and perform additional routines. Also using ViSi-Genie magic can help you reduce cost by eliminating the use for a host controller.

      Hope it helps and Regards,

      Eran
      Hi Eran, thank you so much for the comprehensive answer and the sample you kindly attached. I think your advice to go the Pro route sounds very sensible. I did a little research on the magic codes and this sounds like an excellent combination of ease of development and flexibility.

      I am looking to keep the logic in the Arduino as simple as possible (mainly because its pretty busy doing other stuff such as servicing footswitches, scribble strips oled screens and handling midi in and out.) so I think the Magic code stuff will really help achieve that.

      Comment


      • #4
        Tim,

        It's nice to know that you have appreciated the magic codes. Truly, it has the capabilities that would allow you to build your project easier. Actually, other than the magic codes, you could also have access on Smart widgets which is a very interesting feature of the pro version.

        Good luck to your project and enjoy building!

        Eran
        Eran

        Comment


        • #5
          Eran, just another couple of questions if I may before I press the button on the pro version.

          I presume if I build a project in visi-genie pro, I can still communicate with the display using the genieArduino library? So I'd like to do all the clever stuff in the display using magic code and then still be able to 'send' the result to the Arduino and equally use the Arduino to bring up various screens within the display.

          Also, is the pro version a single user license? it would be useful for my development partner to be able to look at and use the files I create is this possible or is there a 2 user licence available?

          Comment


          • #6
            Originally posted by Eran View Post
            Tim,

            It's nice to know that you have appreciated the magic codes. Truly, it has the capabilities that would allow you to build your project easier. Actually, other than the magic codes, you could also have access on Smart widgets which is a very interesting feature of the pro version.

            Good luck to your project and enjoy building!

            Eran
            Eran, interesting you mention the smart widgets. With smart widgets is it possible to create a listbox type object? For part of my application it would be very nice if I could use the Arduino to populate a list box and then have the user select an option on the display and pass the result back to the Arduino.

            Comment


            • #7
              Tim,

              1. Yes Tim, the basic Visi-Genie features are still available in the pro version.The pro version just adds features like magic codes and smart widgets. You can also minimize the routines that you want the Arduino to run and let the display handle some of it (particularly display-related ones).
              2. The pro version will work for a single PC Tim. More information about the License can be found here: https://www.4dsystems.com.au/product/4D_Workshop_4_IDE/ under the BUY NOW section.
              3. Yes, list box can be implemented using the smart widgets. This might interest you: https://www.youtube.com/watch?v=HQdGWwzr7Bw . This might help you as well : https://www.youtube.com/watch?v=w1PCTq9H3Dw A lot of things can actually be done in the pro version of Workshop4.

              Regards,

              Eran
              Eran

              Comment


              • #8
                Eran

                That's fantastic, thank you again for your help

                Tim

                Comment


                • #9
                  Originally posted by Eran View Post
                  Tim,

                  1. Yes Tim, the basic Visi-Genie features are still available in the pro version.The pro version just adds features like magic codes and smart widgets. You can also minimize the routines that you want the Arduino to run and let the display handle some of it (particularly display-related ones).
                  2. The pro version will work for a single PC Tim. More information about the License can be found here: https://www.4dsystems.com.au/product/4D_Workshop_4_IDE/ under the BUY NOW section.
                  3. Yes, list box can be implemented using the smart widgets. This might interest you: https://www.youtube.com/watch?v=HQdGWwzr7Bw . This might help you as well : https://www.youtube.com/watch?v=w1PCTq9H3Dw A lot of things can actually be done in the pro version of Workshop4.

                  Regards,

                  Eran
                  Hi again Eran,

                  Today I took your advice and went pro

                  Made a good start to the project and have been playing with the basic password example in the IDE that make use of the magic keyboard event code which is exactly what I need.

                  One thing I notice in most of the examples is that the input from the keyboard seems to be simply printed (putch) and erased from a set position on the screen. What I had hoped to do was direct my keyboard values (via a variable) to some led digit object but I'm struggling to find reference to a function to 'set' the value of an led digit object?

                  Is such a function available / could you point me in the right direction to finding reference to it?

                  Thank for all your help

                  Tim

                  Comment


                  • #10
                    Tim,

                    Glad to hear that you're enjoying the pro version of Workshop4.

                    The value of leddigits object can be simply updated using the function WriteObject. There is actually a number of callable functions for Visi-Genie Magic. The list can be found in the Section 6 of Workshop4 IDE VISI–GENIE REFERENCE MANUAL (Opened when F1 is pressed while an object is selected).

                    *Attached is an example of what you’re trying to implement. I have also included the first feature of your project about touching one of the LED objects. You can always change the GUI and code of this example.

                    Hope it helps and regards,
                    Eran
                    Attached Files
                    Eran

                    Comment


                    • #11
                      Eran

                      Thanks amazing thank you so much. The reference manual tip is invaluable LOL I was using an old version that didn't have reference to the magic stuff!

                      Do you know if there is an example available anywhere that shows how to set up a list box? The only other tricky thing in my project will be to receive some data from my Arduino, populate a list box and allow a user to select one of the options (and store that option in a variable).

                      Thanks again for the help!

                      Tim

                      Comment


                      • #12
                        Tim,

                        By that, do you mean that you have opened the Diablo16 Processor Internal Functions Reference Manual? There are actually two manuals that can be opened in the Visi-Genie Magic environment. First is the Diablo 16 Internal Functions Reference Manual that can be opened when a Magic code editor box is open and your cursor is in it. Callable Functions for ViSi-Genie Magic are listed in the second manual (Visi-Genie Reference Manual) that can be accessed when you have selected any object in any form (just click on a widget to select).

                        If this is not the case and your Reference Manual's version is of an older one, you can update your manual by going to File > Options > Updates and click the box Automatically Download Updates then press OK.

                        If the list box contains a list of fixed "names", then you can do that using the Smart widget. The following videos contain list box examples that you may use as reference.
                        1. https://www.youtube.com/watch?v=HQdGWwzr7Bw (00:50 to 1:00)
                        2. https://www.youtube.com/watch?v=hSvNnPwSxnE (00:43 - 00:56)

                        Hope it helps and regards,

                        Eran
                        Eran

                        Comment


                        • #13
                          Hi Eran

                          I think the issue with the manuals was me looking at the wrong documents, what a dope!

                          The list box I need to try and create need to be able to take its list from data I will ultimately get from my host Arduino. (there are several points in my project where I will want to select data from one of several lists and I hope to be able to use one form to service this by dynamically setting up the list) In the first instance I am hoping to simulate setting up the list box by populating it in the display (once I've proved I can do that I'll have a look at comms with the Arduino.)

                          Tim

                          Comment


                          • #14
                            Eran, quick question if I may

                            Given that my list box needs dynamic data would I be right in assuming that smart widgets are not the way to go?

                            I am thinking of building a list box from 'basic' elements eg

                            Have a panel to frame the list box
                            Lay four or five buttons on top to detect which option is pressed
                            Write the indexed contents of my array 'underneath' these buttons
                            Use a slider / buttons to modify the index to change which elements are displayed

                            Does that sound like the right path would you say?

                            Comment


                            • #15
                              Tim,

                              If you really need a listbox with dynamic listnames, this can help you: https://forum.4dsystems.com.au/forum...tbox#post45814
                              NOTE: This example is in designer environment, you can copy the code and paste it into a Magic code in Visi-Genie.

                              About using transparent buttons. The setup is fine, just make sure that every time a button is pressed, the widget under it will be updated right after the button’s touch event. This is because every time you press on a transparent button, what’s under it (static text for example) would be cleared ‘visually’. Remember that whatever is updated the latest comes on the topmost layer and is the one displayed.

                              Another way of implementing this is making multiple list boxes using smart widgets and show the list box containing the name that you have sent form the Arduino; but if you really need to write the list names from the Arduino dynamically, you can use the code above or the one that you’re trying to implement.

                              Best Regards,

                              Eran
                              Eran

                              Comment

                              Working...
                              X