Announcement

Collapse
No announcement yet.

Converting from SGC to GFX

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

  • sspence65
    replied


    I'm glad my efforts made it easier for someone else.

    Leave a comment:


  • PALYGAP
    replied


    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

    Leave a comment:


  • sspence65
    replied


    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)

    Leave a comment:


  • 4DSysFan
    replied


    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....

    Leave a comment:


  • 4DSysFan
    replied


    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....

    Leave a comment:


  • sspence65
    replied


    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

    Leave a comment:


  • ESPsupport
    replied


    Yeah, like post #73



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

    Leave a comment:


  • 4DSysFan
    replied


    Post #73?

    Leave a comment:


  • ESPsupport
    replied


    Have you read the manuals or perused the examples?



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

    Leave a comment:


  • sspence65
    replied


    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.

    Leave a comment:


  • ESPsupport
    replied


    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

    Leave a comment:


  • sspence65
    replied


    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.

    Leave a comment:


  • sspence65
    replied
    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;

    Leave a comment:


  • 4DSysFan
    replied


    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.

    Leave a comment:


  • sspence65
    replied


    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);


    }

    Leave a comment:

Working...
X