Menu

diverent values for single field in outer and inner segment

Mike Nagel
2019-03-14
2021-08-23
  • Mike Nagel

    Mike Nagel - 2019-03-14

    Hello all,
    I've a bulls matrix with 8x12. The Problem is that there are different values if I hit S20 on the inner ring (3) and on the outer ring (K). Is there a way to configure the e.g. S20 to "3 and K" ?

     
    • John Morris

      John Morris - 2021-08-23

      Old thread, but adding this for others who might encounter the same as Mike. I am using an Arachnid Cricket Pro 650 board as a donor board, which has 8 x 11 matrix. This has the same problem was that the outer single panels and the inner single panels were returning different values.

      To solve, I mapped these all out on paper. I then edited the "char keymap[numRows][numCols] " section in the Arduino sketch to return the same value when either the inner or outer Single panel was hit for a number.

      For example, let's say the outer Single panel for 10 was returning a "=", but the inner Single panel for 10 was returning a ")". I just switched the code in the Arduino sketch so that inner single panel also returned a "=". So if either inner the single panel or the outer single panel is hit, the same value is returned and seen by Pydarts as a the same (an S10 in this example)

      Works flawlessly, without any other code changes. I hope this helps someone!

       

      Last edit: John Morris 2021-08-23
  • diego

    diego - 2019-03-14

    Hi, you should implement 3 as S20 and K as s20 as well.
    c u

     
    • Mike Nagel

      Mike Nagel - 2019-03-14

      I've tried this way:

      [SectionKeys]
      S20:3
      S20:K
      S1:4
      S1:L
      S18:5
      S18:q
      S4:6
      S4:f
      S13:B
      S13:Z
      S6:M
      S6:Y
      S10:p
      S10:Y
      S15:o
      S15:X
      S2:k
      S2:W
      S17:j
      S17:_
      S3:i
      S3:^
      S19:D
      S19:]
      S7:7
      S7:\
      S16:+
      S16:[
      S8:,
      S8:O
      S11:-
      S11:h
      S14:.
      S14:E
      S9:/
      S9:F
      S12:1
      S12:G
      S5:=
      S5:U
      

      But it doesn't work...

       
      • poilou

        poilou - 2019-03-15

        Hi Mike !

        I can tell you straight away that what you try to do has not been
        implemented.

        To do so, we have change A LOT of things in the main code, and in games
        as well.

        Would be an idea to fork the code if you decide to go this way.

        Cheers

        On 14/03/2019 14:16, Mike Nagel wrote:

        I've tried this way:
        ~~~
        [SectionKeys]
        S20:3
        S20:K
        S1:4
        S1:L
        S18:5
        S18:q
        S4:6
        S4:f
        S13:B
        S13:Z
        S6:M
        S6:Y
        S10:p
        S10:Y
        S15:o
        S15:X
        S2:k
        S2:W
        S17:j
        S17:_
        S3:i
        S3:^
        S19:D
        S19:]
        S7:7
        S7:\ S16:+
        S16:[
        S8:,
        S8:O
        S11:-
        S11:h
        S14:.
        S14:E
        S9:/
        S9:F
        S12:1
        S12:G
        S5:=
        S5:U
        ~~~
        But it doesn't work...


        diverent values for single field in outer and inner segment


        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pydarts/discussion/general/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         
  • Anonymous

    Anonymous - 2019-03-15

    ???
    you did not write the matrix with numbers?
    1 matrix number correspond to a part of the board.
    for example, if you hit the triple 9 which correspond to the number 71 of your column/row matrix, the soft will affich 71.
    In the config file just write :
    71 : T9

    seems right poilou?

     
    • Mike Nagel

      Mike Nagel - 2019-03-15

      the original config from my arduino mega is:

      char keymap[numRows][numCols] = {
        {33,34,35,36,37,38,39,40,41,42,43,44},
        {45,46,47,48,49,50,51,52,53,54,55,56},
        {57,58,59,60,61,62,63,64,65,66,67,68},
        {69,70,71,72,73,74,75,76,77,78,79,80},
        {81,82,83,84,85,86,87,88,89,90,91,92},
        {93,94,95,96,97,98,99,100,101,102,103,104},
        {105,106,107,108,109,110,111,112,113,114,115,116},
        {117,118,119,120,121,122,123,124,125,126,128,129},
        {130,131,132,133,134,135,136,137,138,139,140,141}
      };
      
      byte rowPins[numRows] = {A0, A1, A2, A3, A4, A5, A6, A7, A8};
      byte colPins[numCols] = {22, 24, 26, 28, 30, 32, 34, 36, 23, 25, 27, 29};
      

      The section keys are not the original config yet.
      I've find a way to use my board with pydarts ;)

      To use the inner and outer single fields I've spend a bit of time to the code and do the following (do not lought, I'am not a programmer
      first I maked a config for the inner single segments
      second I maked a config for the outer segments
      * then I used the config for the outer segments and expand it with the inner segments like:

      [SectionKeys]
      S20:3
      iS20:K
      and so on
      

      In the file CConfig.py I modified the List under "ConfigList['SectionKeys'] = {"
      and
      self.DefaultScoreMap = {
      like

      ConfigList['SectionKeys'] = {
                                              's20':'',
                                              'is20':'',
                                              'd20':'',
                                              't20':'',
                                              's19':'',
                                              '1s19':'',
                                              'd19':'',
                                              't19':'',
                                              's18':'',
                                              's18':'',
                                              and so on.....
      
      self.DefaultScoreMap = {'SB': 25,'DB': 50,
                  'S20': 20, 'iS20': 20, 'D20': 40, 'T20': 60,
                  'S19': 19,'iS19': 19,'D19': 38,'T19': 57,
                  'S18': 18,'iS18': 18,'D18': 36,'T18': 54,
      
                  and so on....
      

      This works for all segments but If you hit the "inner single 7" the software crash. With only inner segment config it works like a charme for the inner.....
      With only outer segment config it works like a charme to for the outer.....
      Do you have any idea why the software crashes only by hiting the inner 7?? Every other segments are working.
      I've tried different arduino configs and changing rows. I've used serial monitor and I mean the board and arduino are working correct.

      I've tried to debug the software, are there any logfiles or so on in debug mode?

      cheers

       
      • Anonymous

        Anonymous - 2019-03-19

        Hi,
        you have to know which value the soft send when you hit the target.
        I reckon filling the matrix with number does not work.
        I think you have to put a single character.
        c u

        ----- Mail original -----

        De: "Mike Nagel" superaddi@users.sourceforge.net
        À: "[pydarts:discussion]" general@discussion.pydarts.p.re.sourceforge.net
        Envoyé: Vendredi 15 Mars 2019 15:03:26
        Objet: [pydarts:discussion] Re: diverent values for single field in outer and inner segment

        the original config from my arduino mega is:
        char keymap[numRows][numCols] = {
        {33,34,35,36,37,38,39,40,41,42,43,44},
        {45,46,47,48,49,50,51,52,53,54,55,56},
        {57,58,59,60,61,62,63,64,65,66,67,68},
        {69,70,71,72,73,74,75,76,77,78,79,80},
        {81,82,83,84,85,86,87,88,89,90,91,92},
        {93,94,95,96,97,98,99,100,101,102,103,104},
        {105,106,107,108,109,110,111,112,113,114,115,116},
        {117,118,119,120,121,122,123,124,125,126,128,129},
        {130,131,132,133,134,135,136,137,138,139,140,141}
        };

        byte rowPins[numRows] = {A0, A1, A2, A3, A4, A5, A6, A7, A8};
        byte colPins[numCols] = {22, 24, 26, 28, 30, 32, 34, 36, 23, 25, 27, 29};

        The section keys are not the original config yet.
        I've find a way to use my board with pydarts ;)

        To use the inner and outer single fields I've spend a bit of time to the code and do the following (do not lought, I'am not a programmer
        first I maked a config for the inner single segments
        second I maked a config for the outer segments
        * then I used the config for the outer segments and expand it with the inner segments like:
        [SectionKeys] S20:3 iS20:K and so on

        In the file CConfig.py I modified the List under "ConfigList ['SectionKeys'] = {"
        and
        self.DefaultScoreMap = {
        like
        ConfigList['SectionKeys'] = {
        's20':'',
        'is20':'',
        'd20':'',
        't20':'',
        's19':'',
        '1s19':'',
        'd19':'',
        't19':'',
        's18':'',
        's18':'',
        and so on.....

        self.DefaultScoreMap = {'SB': 25,'DB': 50,
        'S20': 20, 'iS20': 20, 'D20': 40, 'T20': 60,
        'S19': 19,'iS19': 19,'D19': 38,'T19': 57,
        'S18': 18,'iS18': 18,'D18': 36,'T18': 54,

                and so on....
        

        This works for all segments but If you hit the "inner single 7" the software crash. With only inner segment config it works like a charme for the inner.....
        With only outer segment config it works like a charme to for the outer.....
        Do you have any idea why the software crashes only by hiting the inner 7?? Every other segments are working.
        I've tried different arduino configs and changing rows. I've used serial monitor and I mean the board and arduino are working correct.

        I've tried to debug the software, are there any logfiles or so on in debug mode?

        cheers

        diverent values for single field in outer and inner segment

        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pydarts/discussion/general/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         
        • Mike Nagel

          Mike Nagel - 2019-03-19

          Working with decimal value of the key works perfect, I've tested with serial monitor in Arduino IDE and directly om tke rpi witch cu.

           
  • Mike Nagel

    Mike Nagel - 2019-03-18

    Hello folk,
    the problem with the inner 7 is solved. I had a copy and paste error in self.DefaultScoreMap.

    cheers
    Mike

     
  • Mike Nagel

    Mike Nagel - 2019-03-19

    there are still problems, Ho one works. But cricket doesn't work. I think poilou is right, there are many thinks to do it working with all the Games.

    I've one other idea. Maybe it's possible and easier to modify the value from example for the inner 9 to the value of the outer 9 and send this to the rpi... I will try it in the next days.

     
  • Mike Nagel

    Mike Nagel - 2019-04-03

    Hello,
    now it's running like a charme. Because there were many things to change to get it running with a quadro matrix I've thinking a lot of how to get it to work. The solution was to modify the ASCII values before it was send to the rpi and pydarts. So I've changed the code on the arduino and rewrite the values for e.g. the inner 7 segment to the the value of the outer 7. So with 20 if statements I changed the matrix for pydarts view from four to three segments per number. Here is my original scratch, maybe it will help other people:

    const byte numRows = 9;
    const byte numCols = 12;
    const int debounceTime = 100;
    
    char keymap[numRows][numCols] = {
      {33,34,35,36,37,38,39,40,41,42,43,44},
      {45,46,47,48,49,50,51,52,53,54,55,56},
      {57,58,59,60,61,62,63,64,65,66,67,68},
      {69,70,71,72,73,74,75,76,77,78,79,80},
      {81,82,83,84,85,86,87,88,89,90,91,92},
      {93,94,95,96,97,98,99,100,101,102,103,104},
      {105,106,107,108,109,110,111,112,113,114,115,116},
      {117,118,119,120,121,122,123,124,125,126,128,129},
      {130,131,132,133,134,135,136,137,138,139,140,141}
    };
    
    byte rowPins[numRows] = {A0, A1, A2, A3, A4, A5, A6, A7, A8}; //connect to the row pinouts of the keypad
    byte colPins[numCols] = {22, 24, 26, 28, 30, 32, 34, 36, 23, 25, 27, 29};
    
    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 ");*/
        /* S20 */
        if( key == 77 ) {
          key = 53;
        }
        /* S1 */
        if( key == 78 ) {
          key = 54;
        }
        /* S18 */
        if( key == 115 ) {
          key = 55;
        }
        /* S4 */
        if( key == 104 ) {
          key = 56;
        }
        /* S13 */
        if( key == 92 ) {
          key = 68;
        }
        /* S6 */
        if( key == 91 ) {
          key = 79;
        }
        /* S10 */
        if( key == 90 ) {
          key = 114;
        }
        /* S15 */
        if( key == 89 ) {
          key = 113;
        }
        /* S2 */
        if( key == 97 ) {
          key = 109;
        }
        /* S17 */
        if( key == 96 ) {
          key = 108;
        }
        /* S3 */
        if( key == 95 ) {
          key = 107;
        }
        /* S19 */
        if( key == 94 ) {
          key = 70;
        }
        /* S7 */
        if( key == 93 ) {
          key = 57;
        }
        /* S16 */
        if( key == 81 ) {
          key = 45;
        }
        /* S8 */
        if( key == 106 ) {
          key = 46;
        }
        /* S11 */
        if( key == 71 ) {
          key = 47;
        }
        /* S14 */
        if( key == 72 ) {
          key = 48;
        }
        /* S9 */
        if( key == 73 ) {
          key = 49;
        }
        /* S12 */
        if( key == 87 ) {
          key = 51;
        }
        /* S5 */
        if( key == 99 ) {
          key = 63;
        }    
        Serial.print(key);
      }
    }
    
    char getKey()
    {
      char key = 0;
      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 - 2019-04-08

      Great !

      Hope this help people who try to build same kind of board...

      Nice job !

      Cheers :)

      On 03/04/2019 11:43, Mike Nagel wrote:

      Hello,
      now it's running like a charme. Because there were many things to change to get it running with a quadro matrix I've thinking a lot of how to get it to work. The solution was to modify the ASCII values before it was send to the rpi and pydarts. So I've changed the code on the arduino and rewrite the values for e.g. the inner 7 segment to the the value of the outer 7. So with 20 if statements I changed the matrix for pydarts view from four to three segments per number. Here is my original scratch, maybe it will help other people:
      ~~~
      const byte numRows = 9;
      const byte numCols = 12;
      const int debounceTime = 100;

      char keymap[numRows][numCols] = {
      {33,34,35,36,37,38,39,40,41,42,43,44},
      {45,46,47,48,49,50,51,52,53,54,55,56},
      {57,58,59,60,61,62,63,64,65,66,67,68},
      {69,70,71,72,73,74,75,76,77,78,79,80},
      {81,82,83,84,85,86,87,88,89,90,91,92},
      {93,94,95,96,97,98,99,100,101,102,103,104},
      {105,106,107,108,109,110,111,112,113,114,115,116},
      {117,118,119,120,121,122,123,124,125,126,128,129},
      {130,131,132,133,134,135,136,137,138,139,140,141}
      };

      byte rowPins[numRows] = {A0, A1, A2, A3, A4, A5, A6, A7, A8}; //connect to the row pinouts of the keypad
      byte colPins[numCols] = {22, 24, 26, 28, 30, 32, 34, 36, 23, 25, 27, 29};

      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 ");/
      / S20 /
      if( key == 77 ) {
      key = 53;
      }
      / S1 /
      if( key == 78 ) {
      key = 54;
      }
      / S18 /
      if( key == 115 ) {
      key = 55;
      }
      / S4 /
      if( key == 104 ) {
      key = 56;
      }
      / S13 /
      if( key == 92 ) {
      key = 68;
      }
      / S6 /
      if( key == 91 ) {
      key = 79;
      }
      / S10 /
      if( key == 90 ) {
      key = 114;
      }
      / S15 /
      if( key == 89 ) {
      key = 113;
      }
      / S2 /
      if( key == 97 ) {
      key = 109;
      }
      / S17 /
      if( key == 96 ) {
      key = 108;
      }
      / S3 /
      if( key == 95 ) {
      key = 107;
      }
      / S19 /
      if( key == 94 ) {
      key = 70;
      }
      / S7 /
      if( key == 93 ) {
      key = 57;
      }
      / S16 /
      if( key == 81 ) {
      key = 45;
      }
      / S8 /
      if( key == 106 ) {
      key = 46;
      }
      / S11 /
      if( key == 71 ) {
      key = 47;
      }
      / S14 /
      if( key == 72 ) {
      key = 48;
      }
      / S9 /
      if( key == 73 ) {
      key = 49;
      }
      / S12 /
      if( key == 87 ) {
      key = 51;
      }
      / S5 /
      if( key == 99 ) {
      key = 63;
      }
      Serial.print(key);
      }
      }

      char getKey()
      {
      char key = 0;
      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
      }

      ~~~


      diverent values for single field in outer and inner segment


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pydarts/discussion/general/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • Cory Baumgart

    Cory Baumgart - 2019-05-06

    I'm a bit late to the party, but my board was also setup for inner and outer rings as well. I solved the problem by tying my inner and outer rings together. I took what would have been an 10x11 matrix and made it 8x11.

    I will get pictures when I get to the basement!

     

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.