Announcement

Collapse
No announcement yet.

ViSi Genie keypad and Arduino code - Help!

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

  • Rawabi
    started a topic ViSi Genie keypad and Arduino code - Help!

    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] = {
    {'1','2','3'},
    {'4','5','6'},
    {'7','8','9'},
    {'#','0','*'}
    };
    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(){
    Serial.begin(9600);
    genieSetup (9600);
    }

    void loop(){

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

    if (key != NO_KEY){
    Serial.println(key);
    }
    }

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


    your help is appreciated,
    thanks
    Attached Files

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

    Leave a comment:


  • tonton81
    replied
    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
    Tony

    Leave a comment:


  • huy373
    replied
    Hello,
    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.
    ---xxx---
    Huy

    Leave a comment:


  • pauleilio
    replied
    Hello,

    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

    Paul

    Leave a comment:


  • huy373
    replied
    Hello,
    Can anyone help me please. I have a trouble with building a new project as picture.
    Thank you so much
    Attached Files

    Leave a comment:


  • huy373
    commented on 's reply
    Thanks alot Paul. I will try my best.

  • pauleilio
    replied
    Hi,

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

    http://www.4dsystems.com.au/appnote/4D-AN-00003/
    http://www.4dsystems.com.au/download...0003_R_1_0.pdf

    I hope this helps

    Best regards

    Paul

    Leave a comment:


  • huy373
    replied
    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,
    Huy

    Leave a comment:


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

    Leave a comment:


  • tonton81
    replied
    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.

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

    Leave a comment:

Working...
X