Announcement

Collapse
No announcement yet.

How to show a UserImage "frame" via Serial commands?

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

  • How to show a UserImage "frame" via Serial commands?

    I created a .gci and .dat with Genie; one form contains a UserImage with 3 images (let's call them "frames").
    Using the Genie API (via serial), I can do
    genie.WriteObject(GENIE_OBJ_USERIMAGES, imgid, imgnum);
    to display the desired "frame".

    Is it possible to display any frame other than 0 via the Serial interface?
    I am able to display "frame 0" via
    Display.img_Show(hdl, imgidx);
    but don't see a way to cause "frame" 1 to display.

    I realize that I'm mixing environments, but I've been able to do just about everything else on this Genie-created .gci, so it's not totally absurd

    Is this possible?

    Thanks,
    -Dave

  • #2
    genie.WriteObject(GENIE_OBJ_USERIMAGES, INDEX, IMG/FRAME);

    so:

    genie.WriteObject(GENIE_OBJ_USERIMAGES, INDEX, 1);

    or are you looking for a Display.img_Show(hdl, imgidx); solution?

    Comment


    • #3
      Hi Dave,

      This is the way you would pick a particular frame from a UserImage. Coolgauge is the example.

      Display.img_SetWord(hndl, iCoolgauge1, IMAGE_INDEX, frame) ; // where frame is 0 to 100 (for a displayed -1 to -1)
      Display.img_Show(hndl,iCoolgauge1) ;

      I hope this helps

      paul

      Comment


      • Dave Chambers
        Dave Chambers commented
        Editing a comment
        That's EXACTLY what I was looking for, and it works perfectly. THANKS!

      • icstarz2
        icstarz2 commented
        Editing a comment
        So what is the difference between the VISI generated Code:

        img_SetWord(hndl, iUserimages1, IMAGE_INDEX, 0) ; // where frame is 0 to 0
        img_Show(hndl,iUserimages1) ;

        What is the difference between Display.img_XXXXXX and img_XXXXX ?

      • pauleilio
        pauleilio commented
        Editing a comment
        The difference is the Display. command is used in the serial environment with the serial library on an Arduino or 4Duino.
    Working...
    X