MD Parola Bluetooth control

HI,
I'm just a beginer in all that so please, don't hate if im asking about something obvious.
I want control matrix 12*8x8 display with MD_Parola.h library. There is exemple for that control (Parola_Bluetooth_Control, full code below).
I have problem witch calling animations for effect IN and OUT. Here is table.

// Data tables --------------
const textPosition_t textPosition[] = { PA_LEFT, PA_CENTER, PA_RIGHT };
const textEffect_t textEffect[] = 
{
  PA_PRINT, PA_SCROLL_UP, PA_SCROLL_LEFT, PA_SCROLL_RIGHT, PA_SCROLL_DOWN,
#if ENA_SCR_DIA
  PA_SCROLL_UP_LEFT, PA_SCROLL_UP_RIGHT, PA_SCROLL_DOWN_LEFT, PA_SCROLL_DOWN_RIGHT,
#endif // ENA_SCR_DIA
#if ENA_WIPE
  PA_WIPE, PA_WIPE_CURSOR,
#endif  // ENA_WIPES
#if ENA_OPNCLS
  PA_OPENING, PA_OPENING_CURSOR, PA_CLOSING, PA_CLOSING_CURSOR, 
#endif // ENA_OPNCLS
#if ENA_GROW
  PA_GROW_UP, PA_GROW_DOWN, 
#endif // ENA_GROW
#if ENA_MISC
  PA_SLICE, PA_MESH, PA_FADE, PA_DISSOLVE, PA_BLINDS, PA_RANDOM,
#endif //ENA_MISC
#if ENA_SCAN
  PA_SCAN_HORIZ, PA_SCAN_VERT,
#endif // ENA_SCAN
};

So i want to call specyfic effect from that table, but i don't know how to do that, because program is done for calling one after an other, and if i want to set previous effect, i need to go throu all loop. Is there any way to call specyfic one without going throu all loop?

I will also attach a full code example if that would be helpfull.

Parola_Bluetooth_Control.ino (17.3 KB)

If you only want to change the sketch, then change the list of animations to only those that you are interested in. This will restrict the choice but make it shorter to move through the choices. Simply delete the animation types in the list that you don't need, the rest of the code will adjust to the new list.

If you want to make be able to specify the exact animation, then you will need to change both AI2 code and the Arduino sketch. You will need to add a BT command to set the exact animation by the animation code and make some way of selecting that from the AI2 application. This could be quite complicated if you are not beginner.

Here is a program that I wrote to control a 64x8 LED matrix connected to an Uno via Bluetooth with the Parola library. You can specify in, out, text alignment, sprite, speed and many more effects and parameters via a Bluetooth connection. See the attached text file for the command structure and commands. Perhaps there is something that you can use for your project. I use Bluetooth Terminal on my tablet to control the matrix.

parola matrix codes.txt (4.06 KB)

Parola_HelloWorld_BT_2_eeprom_sprite.ino (16.2 KB)

Thanks for replays,
I was sitting at it for all night and i finally figure out how to set that :), Here is switch function for cmd that I changed:

  switch (cmd)
  {
  case PKT_CMD_RESET:
    hwReset();
    break;

  case PKT_CMD_FACSET:
    readGlobal(true);
    PRINTS("\nCMD Factory Settings");
    break;

  case PKT_CMD_BRIGHT:
  {
      int16_t b = atoi(pd);

      if (b < 0 || b > 15)
        sts = PKT_ERR_DATA;
      else
      {
        if (cmd == PKT_CMD_BRIGHT)
        {
          G.intensity = b;
          PRINT("\nCMD Brightness ", G.intensity);
        }
      }
  }
    break;

  case PKT_CMD_IANIM:
  {
      int16_t i = atoi(pd);

      if (i < 0 || i > 25)
        sts = PKT_ERR_DATA;
      else
      {
        if (cmd == PKT_CMD_IANIM)
        {
          G.effectI = i % ARRAY_SIZE(textEffect);
          PRINT("\nCMD Out Animation ", G.effectI);
        }
      }
  }
    break;

  case PKT_CMD_OANIM:
  {
      int16_t o = atoi(pd);

      if (o < 0 || o > 25)
        sts = PKT_ERR_DATA;
      else
      {
        if (cmd == PKT_CMD_OANIM)
        {
          G.effectO = o % ARRAY_SIZE(textEffect);
          PRINT("\nCMD Out Animation ", G.effectO);
        }
      }
  }
    break;

  case PKT_CMD_INVERT:
    G.bInvert = !P.getInvert();
    PRINT("\nCMD Invert ", G.bInvert ? "on" : "off");
    break;

  case PKT_CMD_JUSTIFY:
  {
      int16_t j = atoi(pd);

      if (j < 0 || j > 2)
        sts = PKT_ERR_DATA;
      else
      {
        if (cmd == PKT_CMD_JUSTIFY)
        {
          G.align = j % ARRAY_SIZE(textPosition);
          PRINT("\nCMD Text Align ", G.align);
        }
      }
  }
    break;

  case PKT_CMD_SAVE:
    writeGlobal();
    PRINTS("\nCMD Save");
    break;

  case PKT_CMD_MESSAGE:
    strcpy(newMessage, pd);
    newMessageAvailable = true;
    PRINT("\nCMD Message '", newMessage); PRINTS("'");
    break;

  case PKT_CMD_SPEED:
  case PKT_CMD_TPAUSE:
  {
      int16_t v = atoi(pd);

      if (v < 0 || v > 10000)
        sts = PKT_ERR_DATA;
      else
      {
        if (cmd == PKT_CMD_SPEED)
        {
          G.scrollSpeed = v;
          PRINT("\nCMD Speed ", v);
        }
        else
        {
          G.scrollPause = v;
          PRINT("\nCMD Pause ", v);
        }
      }
    }
    break;

  default:
    sts = PKT_ERR_CMD;
    PRINT("CMD Error - ", cmd);
    break;
  }

I should check forum ealier but at least it's working now.
Thanks again.

I have one more problem, :(.
I wana change font so i can use latin letters, I already set up new font but when i for example wana to write "ó" (243), screen displays "ó" and i don't know why, on font table there is defined that letter so why it don't want to use that? I will attach table because it's to big to send as code.

Also Font table works for 100% because i changed a bit "!" sign and it was displayed as i wanned.

Parola_LatinFont.h (13.3 KB)

You must be telling the software to display the character 195 instead of 243. Have you checked if you are mapping to the correct code?

You may want to read this article as well: Parola A to Z – Handling non ASCII characters (UTF-8) – Arduino++

I think mapping is ok (attached full code).
Is there possibility to check what character (I mean number of it) that is sended to display? So I can check what exacly is happening when i wana display "ó" because, when debuging is on, on serial port it says only that "ó" is sended to screen.

Wyswietlacz_BT.ino.ino (27.4 KB)

To see the number of the character you should print each character of the string as an integer.

for (uint8_t i=0; i<strlen(sz); i++)
  Serial.print((uint8_t) sz[i]);