No announcement yet.

ViSi Genie keypad and Arduino code - Help!

  • Filter
  • Time
  • Show
Clear All
new posts

  • ViSi Genie keypad and Arduino code - Help!

    I'm using uLCD-43PT to create a keypad for the first time, so i have several concerns:
    1-I don't know how to connect the code with the keypad, is it only by using Arduino genie library?
    2- what are the main functions that should be included in the code (if anyone can share a code example that would be very helpful)
    Moreover, this is what i have reached, but I'm not sure of its accuracy:

    #include <genieArduino.h>
    #include <Wire.h>
    #include <Keypad.h>

    #define Form1 0*01;
    int Winbutton1;
    const byte ROWS = 4; //four rows
    const byte COLS = 3; //three columns
    char keys[ROWS][COLS] = {
    byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

    void setup(){
    genieSetup (9600);

    void loop(){

    genieWriteObj (GENIE_OBJ_FORM, 0, 0);
    char key = keypad.getKey();

    if (key != NO_KEY){

    void lcdUpdate(){
    genieWriteObj (GENIE_OBJ_INPUTS, 0, Keyboard1);
    genieWriteObj (GENIE_OBJ_BUTTONS, 0, Winbutton1);

    your help is appreciated,
    Attached Files

  • #2
    have you set the keyboard widget to report message when the keyboard is pressed? the character will be sent to visi-genie arduino library as decimal, you may cast it to a character via (char) command on the output in the event handler, which, I don't see you have enabled in your sketch. Take a look at the example in the visigenie arduino to get an idea of how the event handler is setup and why DoEvents(); is needed in the loop, that will be the only way you'll get the keyboard characters seen by arduino

    also, keypad.h, and all those tables you added, are not even used in this case, they are not needed.

    Last edited by tonton81; 24 April 2017, 03:23 AM.


    • #3
      you select keyboard widget and in the widget properties edit the keyboard layout, you will get a popup with different keypads there


      • #4
        Hello, i'm using arduino and uLCd 43DT, I don't know how to enter value from keypad. When i touch in a field, keypad will appear, and i can enter value to the field from keypad and press ENTER key to set parameters. PLease show me the code.

        Thanks and Best Regards,


        • #5

          This appnote may help, It shows how to create a keypad and how the keypad reports the values.

          I hope this helps

          Best regards



          • huy373
            huy373 commented
            Editing a comment
            Thanks alot Paul. I will try my best.

        • #6
          Can anyone help me please. I have a trouble with building a new project as picture.
          Thank you so much
          Attached Files


          • #7

            I haven't come across that error before, Can I suggest restarting your PC initially and start Workshop 4 again or re-install Workshop 4.

            Best regards



            • #8
              I restarted and re-installed, but it didnt work.
              But the visi example in the library and my old project work. Only create new project cannot.
              i modified my new project in the older, it worked. Help me please.


              • #9
                did you try creating a new project and save it to a different location before compiling? perhaps you are saving/compiling to a read only location or you dont have administrator privilages on system


                • #10
                  @Tony Thank you for your suggestion. I can try but i created the new one as the older. different folder in same drive D.