How to dynamically create an array with this class (this is Teensy Step library for arduino):
class StepControl : IPitHandler, IDelayHandler
{
public:
...
StepControl();
template<size_t N> void move(Stepper* (&motors)[N], float relSpeed = 1);
...
and then this is usage of this class that works 100% but is static:
Stepper J1(0, 1), J2(2, 3), J3(4, 5), J4(6, 7), J5(8, 9), J6(10, 11);
StepControl <> controller;
Stepper *robot[] = {&J1,&J2,&J3,&J4,&J5,&J6};
controller.move(robot);
I want to do sth like this but create array dynamically:
Stepper J1(0, 1), J2(2, 3), J3(4, 5), J4(6, 7), J5(8, 9), J6(10, 11);
StepControl <> controller;
int j = 4
Stepper *robot[j];
robot[0]=&J1;
robot[1]=&J2;
robot[2]=&J2;
robot[3]=&J2;
controller.move(robot);
result: error: no matching function for call to 'StepControl<>::move(Stepper* [j])'
How to do this?