Menu

Can someone help a noob with this board?

2017-04-11
2021-03-13
1 2 3 > >> (Page 1 of 3)
  • Daniel Möllers

    Daniel Möllers - 2017-04-11

    Hello all.

    first of all sorry for my crapy english =D

    I have tried to build a dart board with a arduino nano and a 7x12 Matrix.

    pydart detects my board but no press on the board will be detecet.

    i have try to bridge for example a5 and d4 to simulate a button press and eliminate wrong wirring.

    Heres my code:

    / @file CustomKeypad.pde
    || @version 1.0
    || @author Alexander Brevig
    || @contact alexanderbrevig@gmail.com
    ||
    || @description
    || | Demonstrates changing the keypad size and key values.
    || #
    /
    /#include <Keypad.h>
    /
    const byte numRows = 7; //four rows
    const byte numCols = 12; //four columns
    const int debounceTime = 100;//20 works better than great !
    //define the cymbols on the buttons of the keypads
    char keymap[numRows][numCols] = {
    {'0','1','2','4','5','6','7','8','9','*','/','_'},
    {'a','b','c','d','e','f','g','h','i','?','!','<'},
    {'j','k','l','m','n','o','p','q','r','&','$','>'},
    {'s','t','u','v','w','x','y','z','A','@','#','>'},
    {'B','C','D','E','F','G','H','I','J','}','('},
    {'K','L','M','N','O','P','Q','R','S',')','='},
    {'T','U','V','W','X','Y','Z','+','-',']','['},
    };
    byte rowPins[numRows]
    = {A1, A2, A3, A4, A5, A6, A7}; //connect to the row pinouts of the keypad
    byte colPins[numCols] = {13, 12, 11, 10, 9, 8 ,7, 6, 5, 4, 3, 2}; //connect to the column pinouts of the keypad

    //initialize an instance of class NewKeypad
    /Keypad customKeypad = Keypad( makeKeymap(Keys), rowPins, colPins, ROWS, COLS);
    /
    void setup()
    {
    Serial.begin(9600);
    for (int row = 0; row < numRows; row++)
    {
    pinMode(rowPins[row],INPUT); // Set row pins as input
    digitalWrite(rowPins[row],HIGH); // turn on Pull-ups
    }
    for (int column = 0; column < numCols; column++)
    {
    pinMode(colPins[column],OUTPUT); // Set column pins as outputs
    // for writing
    digitalWrite(colPins[column],HIGH); // Make all columns inactive
    }
    }

    void loop()
    {
    char key = getKey();
    if( key != 0) { // if the character is not 0 then
    // it's a valid key press
    /Serial.print("Got key ");/
    Serial.print(key);
    }
    }

    // returns with the key pressed, or 0 if no key is pressed
    char getKey()
    {
    char key = 0; // 0 indicates no key pressed

    for(int column = 0; column < numCols; column++)
    {
    digitalWrite(colPins[column],LOW); // Activate the current column.
    for(int row = 0; row < numRows; row++) // Scan all rows for
    // a key press.
    {
    if(digitalRead(rowPins[row]) == LOW) // Is a key pressed?
    {
    delay(debounceTime); // debounce
    while(digitalRead(rowPins[row]) == LOW)
    ; // wait for key to be released
    key = keymap[row][column]; // Remember which key
    // was pressed.
    }
    }
    digitalWrite(colPins[column],HIGH); // De-activate the current column.
    }
    return key; // returns the key pressed or 0 if none
    }

     
  • poilou

    poilou - 2017-04-11

    Hi Daniel !
    Welcome to the pyDarts friendly community... Don't worry about the broken english. We all speak here this kind of language.

    Could you try without the extra comma (,) in your .ino file ?
    At the end of the last row...

    I'm not sure but by any chance...?

    Are you successful with any of you bridge trials ?

    Cheers !

     

    Last edit: poilou 2017-04-11
  • Daniel Möllers

    Daniel Möllers - 2017-04-11

    i dont have linux for debugging is there a way for windows?

    the matrix has 7 and 14

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-11

    no success with the bridging

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-11

    i have connect the 7 to a1-a7 of the nano and the 12 to d2-d13

     
  • poilou

    poilou - 2017-04-11

    That seems correct.
    Did you try to remove the extra comma (,) at the end of this row :
    {'T','U','V','W','X','Y','Z','+','-',']','['},

    Sorry I don't know any software to debug with windows. I am exclusively a Linux user.
    But if you find some, your help is welcome. There is obviously something to.

    Good luck !

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-11

    without the comma i got this error:

    arduino_nano_config_7x12_test:18: error: expected '}' before '{' token

    {'a','b','c','d','e','f','g','h','i','?','!','<'}

    ^

    arduino_nano_config_7x12_test:18: error: expected ',' or ';' before '{' token

    arduino_nano_config_7x12_test:19: error: expected unqualified-id before '{' token

    {'j','k','l','m','n','o','p','q','r','&','$','>'}

    ^

    arduino_nano_config_7x12_test:20: error: expected unqualified-id before '{' token

    {'s','t','u','v','w','x','y','z','A','@','#','>'}

    ^

    arduino_nano_config_7x12_test:21: error: expected unqualified-id before '{' token

    {'B','C','D','E','F','G','H','I','J','}','('}

    ^

    arduino_nano_config_7x12_test:22: error: expected unqualified-id before '{' token

    {'K','L','M','N','O','P','Q','R','S',')','='}

    ^

    arduino_nano_config_7x12_test:23: error: expected unqualified-id before '{' token

    {'T','U','V','W','X','Y','Z','+','-',']','['}

    ^

    arduino_nano_config_7x12_test:24: error: expected declaration before '}' token

    };

    ^

    exit status 1
    expected '}' before '{' token

     
  • Chrigu Wuethrich

    Hallo Daniel,
    schau mal unter https://code.visualstudio.com/
    die Software ist Kostenlos und es gibt extensions für Phyton, es sollte auch möglich sein zu debuggen habs aber nie versucht.
    Gruss
    Chrigu

     
  • Andreas

    Andreas - 2017-04-12

    @poilou i overtake in german.
    @Daniel
    Du schreibst das du eine 7x14 Matrix hast, dann muss der Sketch natürlich umgebaut werden.
    Ich guck nachher mal.
    Wenn das Board nicht reagiert ist eigentlich immer ein Hardwarefehler das Problem.
    Poste bitte ein paar Screens, damit man mal sieht was du da gebaut hast.
    Ich nutze den NANO auch und der funktioniert dafür auch.
    Also keine Panik :)


    {'s', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', '@', '#', '>'},

    {'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '}', '('},

    {'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', ')', '='},

    {'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '+', '-', ']', '['},


    ^^^finde den Fehler :)

     

    Last edit: Andreas 2017-04-12
  • Daniel Möllers

    Daniel Möllers - 2017-04-12

    Also ich habe die Anschlussleisten für die Matrix mit dem Nano verbunden.
    Es ist der 7 polige Anschluss an A1-A7 und der 12 polige an D2-D13.
    Sorry mein Fehler nicht 7x14 sondern 7x12 Matrix aber das ich keine Ausgabe bekomme ist ja unabhängig von der Matrix da der Arduino vom Pydart als Board erkannt wird aber egal was ich brücke ich keine Eingabe bekomme.

     

    Last edit: Daniel Möllers 2017-04-12
    • Andreas

      Andreas - 2017-04-12

      Sieht doch erstmal gar nicht so schlecht aus.
      Also wenn du pydarts startest findet pydarts eine serielle Verbindung.
      Welche Version von pydarts benutzt du?
      Welches Windows?
      Im .pydarts Verzeichnis ist eine pydarts.cfg, wenn du die aufmachst kannst du in den debug modus wechseln und nach dem Start hast du auch ein "DOS" Fenster wo nen bisschen was stehen sollte.
      A1-A7 und D2-D13 ist auch OK.
      Poste ruhig noch einmal deinen kompletten Sketch den du auf den Arduino geladen hast.
      Wenn das Programm im Vollbildmodus startest kannst du mit ALT+ENTER in den Fenster Modus wechseln, damit du das DOS Fenster siehst.
      Poste einfach den Inhalt hier

       
  • poilou

    poilou - 2017-04-12

    Hi Lads,
    I still think you can try without the last comma of this part, something like the following :

    char keymap[numRows][numCols] = {
    {'0','1','2','4','5','6','7','8','9','*','/','_'},
    {'a','b','c','d','e','f','g','h','i','?','!','<'},
    {'j','k','l','m','n','o','p','q','r','&','$','>'},
    {'s','t','u','v','w','x','y','z','A','@','#','>'},
    {'B','C','D','E','F','G','H','I','J','}','('},
    {'K','L','M','N','O','P','Q','R','S',')','='},
    {'T','U','V','W','X','Y','Z','+','-',']','['}
    };
    

    I removed only ONE comma, not all of them. Don't know if it can help.

    Did you try the Arduino software to debug ? There is probably something embeded ?

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-12

    i try it without the last comma and no changes. I dont know how debugging on windows works...

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-12

    @Andreas

    Code ist der aus dem ersten Post.
    pydarts v1.0.0 und v1.0.0 RC3
    Windows 10

    Ich habe das problem das ich die cfg gelöscht habe weil ich dachte ich müsse nur die kalibrierung neu machen nun erstellt er mir keine neue weil ich bei singel 20 pressen stehe

     
  • Andreas

    Andreas - 2017-04-12

    hast du das "DOS/Command" Fenster im Hintergrund und kannst du den Inhalt posten?
    Also funktioniert der Sketch jetzt?
    Wichtig ist beim Brücken das pydarts erst beim los lassen (keyUP) reagiert, also nicht eine Brücke gesteckt lassen.
    Wir kriegen das schon hin :)

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-12

    habs doch hinbekommen habe debugging in der cfg von Warnings auf debug gestellt. Aber die Ausgaber in dem Fenster ist die selber wie zuvor.

    [DEBUG] Config file C:\Users\Reepa/.pydarts/pydarts.cfg exists. We use it so...
    [DEBUG] Working on section SectionAdvanced of your config file.
    [DEBUG] Working on section SectionGlobals of your config file.
    [DEBUG] Working on section SectionKeys of your config file.
    [DEBUG] Your detected locale name is "de_DE".
    [DEBUG] Your locale is mapped on locale : "de_DE.UTF-8".
    [DEBUG] Using display mode : 1000x700
    [DEBUG] Successfully loaded serial port COM8 at speed 9600
    Updating debug facility from DEBUG to WARNING and above.

     
  • Andreas

    Andreas - 2017-04-12

    Gut, dann können wir config Fehler ausschliessen.
    Jetzt versuche ein paar pins zu brücken.
    A5 berühren und dann nacheinander D2 bis D10 mal durchtippen ob sich was rührt.

     
  • Andreas

    Andreas - 2017-04-12

    Bei deinem 2 Fotot sieht es nicht so aus, das die Slicks von einander getrennt sind!?

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-12

    Keine reaktion dabei

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-12

    doch sind sie

     
  • Andreas

    Andreas - 2017-04-12

    hmm, das ja komisch.
    Magst du trotzdem noch einmal den Sketch posten und kannst die code tags benutzen
    dann liest sich das leichter.
    Kannst du mit einem Multimeter/Durchgangsprüfer einen Kurzschluss unter der PINS ausschliessen?

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-12
    /* @file CustomKeypad.pde
    || @version 1.0
    || @author Alexander Brevig
    || @contact alexanderbrevig@gmail.com
    ||
    || @description
    || | Demonstrates changing the keypad size and key values.
    || #
    */
    /*#include <Keypad.h>
    */
    const byte numRows = 7; //four rows
    const byte numCols = 12; //four columns
    const int debounceTime = 100;//20 works better than great !
    //define the cymbols on the buttons of the keypads
    char keymap[numRows][numCols] = {
      {'0','1','2','4','5','6','7','8','9','*','/','_'},
      {'a','b','c','d','e','f','g','h','i','?','!','<'},
      {'j','k','l','m','n','o','p','q','r','&','$','>'},
      {'s','t','u','v','w','x','y','z','A','@','#','>'},
      {'B','C','D','E','F','G','H','I','J','}','('},
      {'K','L','M','N','O','P','Q','R','S',')','='},
      {'T','U','V','W','X','Y','Z','+','-',']','['}
    };
    byte rowPins[numRows] = {A1, A2, A3, A4, A5, A6, A7}; //connect to the row pinouts of the keypad
    byte colPins[numCols] = {13, 12, 11, 10, 9, 8 ,7, 6, 5, 4, 3, 2}; //connect to the column pinouts of the keypad
    
    //initialize an instance of class NewKeypad
    /*Keypad customKeypad = Keypad( makeKeymap(Keys), rowPins, colPins, ROWS, COLS); 
    */
    void setup()
    {
      Serial.begin(9600);
      for (int row = 0; row < numRows; row++)
      {
        pinMode(rowPins[row],INPUT);       // Set row pins as input
        digitalWrite(rowPins[row],HIGH);   // turn on Pull-ups
      }
      for (int column = 0; column < numCols; column++)
      {
        pinMode(colPins[column],OUTPUT);     // Set column pins as outputs 
                                             // for writing
        digitalWrite(colPins[column],HIGH);  // Make all columns inactive
      }
    }
    
    void loop()
    {
      char key = getKey();
      if( key != 0) {       // if the character is not 0 then 
                            // it's a valid key press
        /*Serial.print("Got key ");*/
        Serial.print(key);
      }
    }
    
    // returns with the key pressed, or 0 if no key is pressed
    char getKey()
    {
      char key = 0;                                  // 0 indicates no key pressed
    
      for(int column = 0; column < numCols; column++)
      {
        digitalWrite(colPins[column],LOW);         // Activate the current column.
        for(int row = 0; row < numRows; row++)     // Scan all rows for 
                                                   // a key press.
        {
          if(digitalRead(rowPins[row]) == LOW)     // Is a key pressed?
          {
            delay(debounceTime);                   // debounce
            while(digitalRead(rowPins[row]) == LOW)
                ;                                  // wait for key to be released
            key = keymap[row][column];             // Remember which key 
                                                   // was pressed.
          }
        }
        digitalWrite(colPins[column],HIGH);     // De-activate the current column.
      }
      return key;  // returns the key pressed or 0 if none
    }
    

    kein durchgang alles im mohm bereich

     
  • Andreas

    Andreas - 2017-04-12

    sieht alles gut aus.
    Programm mal als Administrator gestartet?

     
  • Daniel Möllers

    Daniel Möllers - 2017-04-12

    pydart oder arduino wärend des schreibens der software auf den nano?

     
  • Andreas

    Andreas - 2017-04-12

    pydarts

     
1 2 3 > >> (Page 1 of 3)

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.