Announcement

Collapse
No announcement yet.

Converting from SGC to GFX

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

  • #76


    I can send one variable at a time through my send function, correct? I don't have to refresh all the variables at the same time?

    int uvga(char* x, int y){

    Serial3.print("$");
    Serial3.print(x);
    Serial3.println(y, DEC);


    }
    Steve Spence KK4HFJ
    http://arduinotronics.blogspot.com

    Comment


    • #77


      As of now, 4DGL program will only handle message IDs A, B, and c (note lowercase). To add more message ID's you'll need to:1) Add more ID chars to lookup8, like lookup8(ID,"ABCDEFGHIJKLMNO");2) Add more subroutines to match in the gosub line.
      _______________
      Best Regards,
      Howard

      Comment


      • #78
        oops. I was setting my A's and B's as variables, not "sending" them. Dang. Ok, uploaded corrected version in previous post. I now get a changing A and B, and you just explained why I'm not getting the rest.

        I now have:

        Code:
         index:= lookup8(ID,"ABCDEFGHIJKLMNOP"); //Message ids,gosub(index),(MSGINVALID,MSGA,MSGB,MSGC,MSGD,MSGE,MSGF,MSGG,MSGH,MSGI,MSGJ,MSGK,MSGL,MSGM,MSGN,MSGO,MSGP);
        and

        Code:
         MSGINVALID: //Here because did not match A,B,or C//print("INVALID Message! \n");endsub;MSGA: //Do something usefullA := msgvalue;endsub;MSGB:B := msgvalue;endsub;MSGC:C := msgvalue;endsub;MSGD:D := msgvalue;endsub;MSGE:E := msgvalue;endsub;MSGF:F := msgvalue;endsub;MSGG:G := msgvalue;endsub;MSGH:H := msgvalue;endsub;MSGI:I := msgvalue;endsub;MSGJ:J := msgvalue;endsub;MSGK:K := msgvalue;endsub;MSGL:L := msgvalue;endsub;MSGM:M := msgvalue;endsub;MSGN:N := msgvalue;endsub;MSGO:O := msgvalue;endsub;MSGP:P := msgvalue;endsub;
        Steve Spence KK4HFJ
        http://arduinotronics.blogspot.com

        Comment


        • #79


          My bin numbers are not displaying correctly, and I'm getting some screen artifacts when I go from say a 4 digit number to a 3 or a long string to a short one. I assume I need to put a , " " in the print statement.
          Steve Spence KK4HFJ
          http://arduinotronics.blogspot.com

          Comment


          • #80


            Use a format specifier to force n digits to be printed or erase the part of the screen where the number will display.



            Also set the text to OPAQUE if it is currently TRANSPARENT
            Mark

            Comment


            • #81


              This shows the problem (some strings are longer than others), and the solution:

              HTML Code:
              if (B == 1) print("Below MP200", " ");
              if (B == 2) print("MP200", " ");
              if (B == 3) print("MP200  MP230", " ");
              Now, what I really need to do, is have a lookup where:

              Over MP390
              MP390
              MP340 MP390
              MP340
              MP280 MP340
              MP280
              MP230 MP280
              MP230
              MP200 MP230
              MP200
              Below MP200

              All equal a different variable, and I use the variable in the print statement, not the actual text?

              Like:

              print(family, " ");

              where family is set to be one of the items in the list.
              Steve Spence KK4HFJ
              http://arduinotronics.blogspot.com

              Comment


              • #82


                Have you read the manuals or perused the examples?



                I'm sure there's plenty of examples that show that sort of thing
                Mark

                Comment


                • #83


                  Post #73?
                  _______________
                  Best Regards,
                  Howard

                  Comment


                  • #84


                    Yeah, like post #73



                    (unless you have 'Post Display order' set to Descending, then it's post #12 and changes with every subsequent post)
                    Mark

                    Comment


                    • #85


                      I'm having problems integrating that. My menu button stopped working.

                      I made changes I thought were appropriate:

                      [HTML] var Z;
                      var Y;
                      var msg_A1[8];
                      var msg_A2[15];
                      var msg_A3[13];
                      msg_A1[0] := " ";
                      msg_A1[1] := "Below W2M";
                      msg_A1[2] := "Webster 2M1";
                      msg_A1[3] := "W2M - WM34";
                      msg_A1[4] := "Webster M34";
                      msg_A1[5] := "WM34 - WM17";
                      msg_A1[6] := "Webster M17";
                      msg_A1[7] := "Over WM17";
                      msg_A2[0] := " ";
                      msg_A2[1] := "Below JH180";
                      msg_A2[2] := "JH180 - JH280";
                      msg_A2[3] := "JH280";
                      msg_A2[4] := "JH280 - JH335";
                      msg_A2[5] := "JH335/340";
                      msg_A2[6] := "JH335 JH437";
                      msg_A2[7] := "JH437";
                      msg_A2[8] := "JH437 JH484";
                      msg_A2[9] := "JH484";
                      msg_A2[10] := "JH484 JH562";
                      msg_A2[11] := "JH562";
                      msg_A2[12] := "JH562 JH750";
                      msg_A2[13] := "JH750";
                      msg_A2[14] := "Over JH750";
                      msg_A3[0] := " ";
                      msg_A3[1] := "Below MP200";
                      msg_A3[2] := "MP200";
                      msg_A3[3] := "MP200 MP230";
                      msg_A3[4] := "MP230";
                      msg_A3[5] := "MP230 MP280";
                      msg_A3[6] := "MP280";
                      msg_A3[7] := "MP280 MP340";
                      msg_A3[8] := "MP340";
                      msg_A3[9] := "MP340 MP390";
                      msg_A3[10] := "MP390";
                      msg_A3[11] := "MP390";
                      msg_A3[12] := "Over MP390";


                      for(Z:=1;Z
                      Steve Spence KK4HFJ
                      http://arduinotronics.blogspot.com

                      Comment


                      • #86


                        It wasn't meant for you to just drop into the program. It was an example of how to assign string constant variables to an array, then use the value of B as the index into the array vs doing tons of comparisons.
                        The for loops just loop through a sequence of numbers to show you how it works. Get rid of them in your code, they were meant only as a display for the stand alone program demo....
                        _______________
                        Best Regards,
                        Howard

                        Comment


                        • #87


                          Also, the msg_A1, etc variable declarations and assignments should not be within the process_msg routine. Move them to the outside of any functions so that they become global. As is, you will be re-assigning them every time you call the function which is a time killer....
                          _______________
                          Best Regards,
                          Howard

                          Comment


                          • #88


                            ah, ok. I'll play with it. meanwhile, the project is working properly now, and needs to go back to production before the 11am meeting. I'm already making a list of changes for version 3. Thank you so much, I've learned a bunch of new things from all of you, but especially you, Howard!


                            Attached files micrometerfinal.4dg (13.6 KB) micrometerGFXPro_ino.txt (30.8 KB)
                            Steve Spence KK4HFJ
                            http://arduinotronics.blogspot.com

                            Comment


                            • #89


                              Thanks Steve for this very instructive thread and for the INSTRUCTABLE that you did.

                              I am currently doing a project with a similar set up (ARDUINO MEGA --> uVGA-II and soon uVGA-III). Thanks to this tread I was able to quickly get going with the serial communication. I am actually using softwareSerial (at 115200 bauds library since the 4 UARTs of the MEGA will be busy doing MIDI communication.

                              Have a happy new year.

                              Cheers,
                              ERIC

                              Comment


                              • #90


                                I'm glad my efforts made it easier for someone else.
                                Steve Spence KK4HFJ
                                http://arduinotronics.blogspot.com

                                Comment

                                Working...
                                X