Announcement

Collapse
No announcement yet.

Converting from SGC to GFX

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

  • #61


    Can I send the column, row position as well? Or am I moving back to slowing down the connection with graphics "design" ...
    Steve Spence KK4HFJ
    http://arduinotronics.blogspot.com

    Comment


    • #62


      For your text messages, you could use an ID of 'T', then the number you send indicates which message you want.
      This is a little kludgy, but you could use an id of 'R' to set the row, id of 'C' to set the column, id of 'T' to set the text message

      If you are setting text rows and columns (not pixel positions), you could use one message to set the row/column position by putting, say, the row in the upper byte and the column in the lower byte of a signed 16 bit int.
      Alternatively, you can modify the state machine to accept space separated variables, then parse the values out in the message handler.
      So many options......
      _______________
      Best Regards,
      Howard

      Comment


      • #63


        I have made a map of each variable, and where it needs to go on the screen (C, R).

        Can I assign each screen postion a variable, and say put variable a in screen position 5, where 5 is 22,03?
        Steve Spence KK4HFJ
        http://arduinotronics.blogspot.com

        Comment


        • #64


          I'm getting lost in the complexity. I supposed to have this finished tomorrow. Sigh .....
          Steve Spence KK4HFJ
          http://arduinotronics.blogspot.com

          Comment


          • #65


            Define the problem, break it down, define the requirements for the data you need to send.
            1) Do the variables (numeric) always display in the same location?2) Do the text messages always display in the same location, or do you need to be able to display the same message in many screen locations?
            _______________
            Best Regards,
            Howard

            Comment


            • #66


              "A" goes to 22, 03 and could be 7 different strings
              "B" goes to 22, 05 and could be 33 different strings
              "C" goes to 15, 07 and is one string in this version of the program
              "D" goes to 35, 07 and is one string in this version of the program
              "E" goes to 17, 9 and is a 3 digit numeric value
              "F" goes to 37, 9 and is a 3 digit numeric value
              "G" goes to 17, 15 and is always "S1" but only shows when S1 is not 0
              "H" goes to 27, 15 and is always "S2" but only shows when S2 is not 0
              "I" goes to 37, 15 and is always "S3" but only shows when S3 is not 0
              "J" goes to 15, 20 and is one string in this version of the program
              "K" goes to 35, 20 and is one string in this version of the program
              "L" goes to 16, 22 and is a 3 digit numeric value (Green or Red)
              "M" goes to 36, 22 and is a 3 digit numeric value (Green or Red)
              "N" goes to 10, 24 and is one string "Reject Bin" but only shows if the gear fails
              "O" goes to 35, 24 and is one of 15 text strings but only shows if gear fails
              Steve Spence KK4HFJ
              http://arduinotronics.blogspot.com

              Comment


              • #67


                For ""G", are you saying that you send a value, but only display "S1" (not the value) when the value is not 0?
                For L and M, When is it red and when green?
                For N and O, what determines that the gear has failed (or rather, how does the uVGA know it has failed)?
                It looks like all the messages are fixed in position so you would not have to send the row/column?
                _______________
                Best Regards,
                Howard

                Comment


                • #68


                  Also, for A,B, etc, will it always display text, or is one of the text strings " " so that it is blank?
                  _______________
                  Best Regards,
                  Howard

                  Comment


                  • #69


                    S1 is an indicator that the arduino has saved a mic value for sampling. The value is not that important to the user, just feedback that it was set. after s3, s1-3 go blank, and the averaged value is displayed in L & M. They are normally green if the 3 samples fall close enough together, but red if to much variation. the arduino knows this, and could send a toggle bit? AB change, CDJK do not. There's another "screen" on the Arduino that I'm not going to implement this round, that moves stuff around a bit. It's called "match" if you look at the arduino code. This section i'm implementing is called sort.
                    Steve Spence KK4HFJ
                    http://arduinotronics.blogspot.com

                    Comment


                    • #70


                      ok, so my immediate need is to be able to Print "Webster Sort" if A = 1, Minipump Sort" if A = 2, or "J/H pump Sort" if A = 3, at postion 22, 3.

                      I don't see case statements, so we use if statements?

                      HTML Code:
                      txt_Set(TEXT_COLOUR, WHITE);
                      
                      txt_MoveCursor(22,3);
                      
                      if (A == 1) print("Webster pump Sort");
                      if (A == 2) print("Mini pump Sort");
                      if (A == 3) print("J/H pump Sort");
                      
                      txt_MoveCursor(22,5);
                      
                      if (A == 1 && B == 1) print("Below W2M");
                      if (A == 1 && B == 2) print("Webster 2M");
                      if (A == 1 && B == 3) print("W2M  WM34");
                      if (A == 1 && B == 4) print("Webster M34");
                      if (A == 1 && B == 5) print("WM34  WM17");
                      if (A == 1 && B == 6) print("Webster M17");
                      if (A == 1 && B == 7) print("Over WM17");
                      
                      if (A == 2 && B == 1) print("Below JH180");
                      if (A == 2 && B == 2) print("JH180");
                      if (A == 2 && B == 3) print("JH180  JH280");
                      if (A == 2 && B == 4) print("JH280");
                      if (A == 2 && B == 5) print("JH280  JH335");
                      if (A == 2 && B == 6) print("JH335/340");
                      if (A == 2 && B == 7) print("JH335  JH437");
                      if (A == 2 && B == 8) print("JH437");
                      if (A == 2 && B == 9) print("JH437  JH484");
                      if (A == 2 && B == 10) print("JH484");
                      if (A == 2 && B == 11) print("JH484  JH562");
                      if (A == 2 && B == 12) print("JH562");
                      if (A == 2 && B == 13) print("JH562  JH750");
                      if (A == 2 && B == 14) print("JH750");
                      if (A == 2 && B == 15) print("Over JH750");
                      
                      if (A == 3 && B == 1) print("Below MP200");
                      if (A == 3 && B == 2) print("MP200");
                      if (A == 3 && B == 3) print("MP200  MP230");
                      if (A == 3 && B == 4) print("MP230");
                      if (A == 3 && B == 5) print("MP230  MP280");
                      if (A == 3 && B == 6) print("MP280");
                      if (A == 3 && B == 7) print("MP280  MP340");
                      if (A == 3 && B == 8) print("MP340");
                      if (A == 3 && B == 9) print("MP340  MP390");
                      if (A == 3 && B == 10) print("MP390");
                      if (A == 3 && B == 11) print("Over MP390");


                      and so on?
                      Steve Spence KK4HFJ
                      http://arduinotronics.blogspot.com

                      Comment


                      • #71


                        You can nest your ifs:
                        if(A==1) if(B==1) print("Message 1"); if(B==2) print("Message 2"); if(B==3) print("Message 3");endifif (A==2) if(B==1) print("Message 4"); if(B==2) print("Message 5"); if(B==3) print("Message 6");endif
                        This is faster as you don't retest A every time.....
                        _______________
                        Best Regards,
                        Howard

                        Comment


                        • #72


                          ok, things are shaping up. I have my screen built, but am missing some conditional logic for S1, S2, and S3, and printing the reject bin doesn't work (have a place holder called "family" as I need to create string variables for all the family names so it can be a calculated field.

                          HTML Code:
                          txt_Set(TEXT_COLOUR, WHITE);
                          txt_BGcolour(BLUE);
                          txt_MoveCursor(3,22);
                          if (A == 1) print("Webster Pump Sort");
                          if (A == 2) print("J/H Pump Sort");
                          if (A == 3) print("Mini Pump Sort");
                          txt_MoveCursor(5,22);
                          if(A==1)
                          if (B == 1) print("Below W2M");
                          if (B == 2) print("Webster 2M");
                          if (B == 3) print("W2M  WM34");
                          if (B == 4) print("Webster M34");
                          if (B == 5) print("WM34  WM17");
                          if (B == 6) print("Webster M17");
                          if (B == 7) print("Over WM17");
                          endif
                          if (A==2)
                          if (B == 1) print("Below JH180");
                          if (B == 2) print("JH180");
                          if (B == 3) print("JH180  JH280");
                          if (B == 4) print("JH280");
                          if (B == 5) print("JH280  JH335");
                          if (B == 6) print("JH335/340");
                          if (B == 7) print("JH335  JH437");
                          if (B == 8) print("JH437");
                          if (B == 9) print("JH437  JH484");
                          if (B == 10) print("JH484");
                          if (B == 11) print("JH484  JH562");
                          if (B == 12) print("JH562");
                          if (B == 13) print("JH562  JH750");
                          if (B == 14) print("JH750");
                          if (B == 15) print("Over JH750");
                          endif
                          if (A==3)
                          if (B == 1) print("Below MP200");
                          if (B == 2) print("MP200");
                          if (B == 3) print("MP200  MP230");
                          if (B == 4) print("MP230");
                          if (B == 5) print("MP230  MP280");
                          if (B == 6) print("MP280");
                          if (B == 7) print("MP280  MP340");
                          if (B == 8) print("MP340");
                          if (B == 9) print("MP340  MP390");
                          if (B == 10) print("MP390");
                          if (B == 11) print("Over MP390");
                          endif
                          // Static screen elements
                          txt_MoveCursor(7,15);
                          print("Static");
                          txt_MoveCursor(7,35);
                          print("Moveable");
                          txt_MoveCursor(20,15);
                          print("Static");
                          txt_MoveCursor(20,35);
                          print("Moveable");
                          // Dynamic screen elements
                          txt_MoveCursor(9,17);
                          print(E);
                          txt_MoveCursor(9,37);
                          print(F);
                          txt_MoveCursor(15,17);
                          print("S1");
                          txt_MoveCursor(15,27);
                          print("S2");
                          txt_MoveCursor(15,37);
                          print("S3");
                          
                          txt_MoveCursor(22,17);
                          print(L);
                          txt_MoveCursor(22,37);
                          print(M);
                          txt_Set(TEXT_COLOUR, RED);
                          txt_MoveCursor(24,13);
                          print("Reject Bin");
                          txt_MoveCursor(24,35);
                          print("family");

                          Attached files ComStateMachine.4dg (10.9 KB)
                          Steve Spence KK4HFJ
                          http://arduinotronics.blogspot.com

                          Comment


                          • #73


                            Just to throw one more thing at you, here is a way to eliminate a lot of the testing......You would need to modify as required, but it shows the idea....

                            Attached files stringconst.4dg (981 B)
                            _______________
                            Best Regards,
                            Howard

                            Comment


                            • #74


                              I don't even understand that. I'll try to in a bit.

                              In the mean time, please look at these two files and tell me what you think. I think it's almost done. I have to go wire up two switches (menu and sample), but I'll be back in a bit.


                              Attached files ComStateMachine.4dg (10.9 KB) micrometerGFXPro_ino.txt (31.2 KB)
                              Steve Spence KK4HFJ
                              http://arduinotronics.blogspot.com

                              Comment


                              • #75


                                I get a blank blue screen on power up. That's because I have not enabled the default screen, which is the instructions screen.

                                I press the menu button, and I get a Screen with static descriptions, but my E & F are not updating as I spin the mic. My A & B aren't printing out either.
                                Steve Spence KK4HFJ
                                http://arduinotronics.blogspot.com

                                Comment

                                Working...
                                X