Už jsem to vyřešil:
SerialStepper.h
#ifndef SerialStepper_h
#define SerialStepper_h
#include <Arduino.h>
class SerialStepper
{
public:
SerialStepper (byte pin_STCP,
byte pin_SHCP,
byte pin_DS,
byte pocetM,
int motory[]);
void Init();
private:
byte _pin_STCP;
byte _pin_SHCP;
byte _pin_DS;
byte _pocetM;
int * _motory = NULL; // Inicializacia pointera
};
#endif
SerialStepper.cpp
#include <Arduino.h>
#include "SerialStepper.h"
SerialStepper::SerialStepper( byte pin_STCP,
byte pin_SHCP,
byte pin_DS,
byte pocetM,
int motory[])
{
this->_pin_STCP = pin_STCP; // priradenie k lokalnym
this->_pin_SHCP = pin_SHCP; // premennym
this->_pin_DS = pin_DS;
this->_pocetM = pocetM;
this->_motory = & motory[0]; // Priradenie adresy
}
A práce s lokálními proměnnými v SerialStepper.cpp už je klasika:
.......
digitalWrite (_pin_STCP,HIGH);
.......
digitalWrite (_pin_SHCP,LOW );
.......
digitalWrite (_pin_DS,LOW );
.......
for (byte i = _pocetM; i>0 ;i--)
{
Motory = _motory[i-1];
.......