Protocol for avoiding pointers

Something like:

struct Motor {
  int stepPin;
  int dirPin;
  int direction;
  int RPM;
  bool run;
  int steps;
};

Motor myMotors[4];

myMotor[0].stepPin=13;

Be aware that arrays start counting at 0!

1 Like