No announcement yet.

Switch Coolgauge, Popup Keypad.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Switch Coolgauge, Popup Keypad.

    Hello everybody,

    I´m using Visi-Genie for a few weeks now. Works fantastic an it´s easy to use! You can make lots of cool stuff in a few Minutes even without very good porgramming skills.

    Now I have two Problems I could not find a solution.

    Ich have to make a Controlscreen for an experimental car an have different Forms on my Screen.
    On the first Screen, (I attached a Screenshot) are 2 collgauges.(Speed and R.P.M.) The left Gauge should be in 3 different speed Types (m/s--> knots --> and km/h) So I just put 3 coolgaues one above the other and set the event to the next one. (Last one to first one) I hoped that I can cycle through the 3 Gauges. But nothiing will happen, touching the Gauge. (Mayby I have to put a user button over the hole Gauge?) Is it even possible with visi genie?

    Second screen shot.
    The oder Problem I have is on the second Screenshot. There are five aktuators on the Car which can set by Buttons while Driving (Works prefekt). My Professor now want to "pre set" the position an speed of the actuators, by touching the the gauges. He asked if it is possible to touch one gauge, an a keyboard will pop up (I tried that with a different form) where you can enter the valves. Problem with just a different form, that your Keyboard does not know which Gauge was pressed, an which Value to chanche. I tried to solve that Problem in Arduino, but its need quite al lot code, and does not work good.... Any suggestions?

    Thanks al lot for your help! :-)
    Attached files

  • #2

    A gauge is output only in Genie.

    If you wrote your project in ViSi you would be able to make a gauge so you can touch it to do various things, but not in Genie. You could always 'save as' your project to convert it from Genie, but there would be a lot of work involved as you would need how to add the touch part to the protocol.

    Would be better to add a button to change the settings, you MIGHT be able to place a transparent user button over the top of the gauge, I haven't tried it.

    If you placed 3 gauges over the top of each other the last one to be written to would be displayed on the top, so that might be the way to get around that problem.


    • #3

      Thanks for your Answer!

      I tried it with a User Button, but there is no posibility to select a "Gauge" as an event.

      So I have to save it as a Visi Projekt an do it manualy or begin a complete New Projekt. My display programming skills are not the best, so I have to do a lot of studying...

      But it is worth to do it. If the prototype phase is completed, we plan to build several thousand vehicles with the same screen... Therefore, it is necessary that everything works perfectly. Much, much work.


      • #4

        No, you do it a bit different to that.

        You set the user button to 'Report Message'

        On the controlling system you only write to one gauge.

        When you receive a button press you change the gauge you write to.

        I tried it with an 'empty' user button and it worked fine.

        What course are you doing?


        • #5

          Thank you very much Mark!

          It worked as you said!

          HTML Code:
          void handleGenieEvent (void) 
            genieFrame event;
              if (event.reportObject.object == GENIE_OBJ_USERBUTTON) 
              if (event.reportObject.index == 0)                 // Button 0 Change Gauge 
               if ( gauge == 3)gauge = 0;
          And this
          genieWriteObject(GENIE_OBJ_COOL_GAUGE, gauge, speed_gauge);
          void speed_con()
          if (gauge ==0)
          {speed_gauge = GPS.speed;}  //knots
          if (gauge ==1)
          {speed_gauge = GPS.speed * 1,852;}  //km/h
          if (gauge ==2)
          {speed_gauge = GPS.speed * 0,51444;}  //m/s
          You can put as many "stuff" above each other, as you want. Interesting thing is, that the Gauge which recives values from the Controller is alwas on Top! So you have to be carfull not writing in "inaktiv" Gauges, as I did befor. So the code must select the gauge and the proper inputvalue.

          Now I hope, I can solve the other Problem too. Maybe you can take a look on it too? I attached a screenshot. There is only 1 of 4 sets (each wheel has one)

          The values on the right (Blue) ist curent state. The Red should be set by the keyboard.
          I put a userbutton under the red digits. But now I dont know how to do the rest. (Connecting the kayboard input to the value (userbutton) i pushed...)
          I later want to set all 8 values and then push "set" button. All blue values change to the red ones...

          Im sudying air and spacecraft engineering. What I do now, is making my master degree in a small company. We are working on a new funsport vehicle. I´m in charge with all the controling stuff an electronics.


          Attached files


          • #6

            Today I checked the example code of the calculator.

            While setting is in progress, the main loop can stop.
            Maybe, that could be a way to get what I want, but it does not work jet.

            I put the keyboard in the if loop, after getting info the userbutton2 ist pressed. I tried set with a while loop. The Programm should wait, till the is input from the keyboard.
            Now the user should type in a value between 0-100%

            This value shoud be stored somewere.

            Then go to the next value, type userbutton, set value

            After some, or all values are set, the user hits the "Back" Button in the middel down of the screen and alle blue values shoold chanche to the red ones....

            HTML Code:
              if (event.reportObject.object == GENIE_OBJ_USERBUTTON) 
               if (event.reportObject.index == 2)  
                   while (event.reportObject.object == GENIE_OBJ_KEYBOARD) // If this event is from a Keyboard
                     if (event.reportObject.index == 0)        // If from Keyboard0
                       keyboardValue = genieGetEventData(&event); // Get data from Keyboard0
                       touchKey (keyboardValue); // pass data to the calculatorKey function for processing


            • #7

              The keyboard should be reporting back to your controller which should be 'building' the appropriate number from what the keyboard is sending and passing it back to the led or custom digits.


              • #8

                You can simply check for everything in one loop, after all, you know that certain inputs are only possible at certain times (i.e. when the form containing them is displayed)


                • #9

                  Hi Mark,

                  thanks for your Help!

                  now everything is working fine!

                  I found a solution.

                  -If i touch a button, which ist just an empty userbutton over the Digit I want to chanche, I set a canal e.g. "4" open. This canal is also mapped to that Leddiggid.

                  -While this chanel is open, the nummbers of the Keypad are written in the fourth place of the "Temp Array Display" an the "set diggit".

                  -To "bulid" the nummer I use the code form the calculator, but without floats, just ints. If you press "set" on the key pad, the canel is cloased.

                  - So now you have your Value in The Temp Array.

                  -After that, pushing the "activate all" Button, the whole Temp Array is written to the Actuator Array.

                  If you or someone else is interested in the Code, feel free to ask and I will post it here.


                  • peter1929
                    peter1929 commented
                    Editing a comment
                    Hi I am interested in some thing similar where to control 4 linear actuators so all move at same time (keep in sync),can you please send me the code to look at ?



                • #10
                  I have a led digit and a key pad, i don't know how to set the value for the digit to control the temperature or something else can enter the value from keypad not obliged the digit (i use Arduino uno, DS18B20 and uLCD 43DT). Please show me the example code please.
                  Thanks and best regards,
                  Attached Files
                  Last edited by huy373; 28 December 2017, 01:31 AM.


                  • #11
                    Hello Huy,

                    Can you let me know what programming evironment you are using, Visi, Visi-genie etc

                    Best regards



                    • #12
                      Dear Paul,
                      I used Visi-genie to do my project. Thanks for your help.


                      • #13

                        With Visi-genie you will have to read each keypress in your Uno and build an array or string using the values of the the keypress's. It is sometimes easier to build a string because it can be of variable length and when the Enter key is pressed you can convert it to an integer using string.toInt();

                        The integer can then be written to the LedDigit object.

                        This appnote may help


                        I hope this helps.

                        Best regards



                        • #14
                          Thank you Paul.