Hallo,

ich bin nicht so der C-Experte, aber ich denke in neurem C (ISO-Standard C99 oder C11 ?) ist sowas erlaubt
Code:
void f(int n)
{
    int16_t a[n];

    // Beispiel ...
    a[0] = 42;
}
das ist dann ein VLA (Variable Length Array).

Ein Problem in der Arduino IDE dürfte sein, dass das eigentlich C++ (nach 2003 Standard) ist. In C++ gibt es keine VLA.

Ab dem 2011er Standard würde in C++ aber gehen
Code:
void f(int n)
{
    std::array<int16_t, n> a;

    // Beispiel ...
    a[0] = 42;
}