Mělo to tam být bez int (u Stepper), takto:
Kód: Vybrat vše
MujMotor::MujMotor(int a, int b, int c, int d, int e):Stepper(number_of_steps, motor_pin_1, motor_pin_2, motor_pin_3, motor_pin_4){
}
EDIT: tak i tuhletu mámC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Stepper\src/Stepper.h: In constructor 'MujMotor::MujMotor(int, int, int, int, int)':
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Stepper\src/Stepper.h:106:9: error: 'int Stepper::number_of_steps' is private
int number_of_steps; // total number of steps this motor can take
^
sketch_nov24c:18:63: error: within this context
MujMotor::MujMotor(int a, int b, int c, int d, int e):Stepper(number_of_steps, motor_pin_1, motor_pin_2, motor_pin_3, motor_pin_4){
^
In file included from C:\Users\bartv\AppData\Local\Temp\arduino_modified_sketch_4856\sketch_nov24c.ino:1:0:
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Stepper\src/Stepper.h:111:9: error: 'int Stepper::motor_pin_1' is private
int motor_pin_1;
^
sketch_nov24c:18:80: error: within this context
MujMotor::MujMotor(int a, int b, int c, int d, int e):Stepper(number_of_steps, motor_pin_1, motor_pin_2, motor_pin_3, motor_pin_4){
^
In file included from C:\Users\bartv\AppData\Local\Temp\arduino_modified_sketch_4856\sketch_nov24c.ino:1:0:
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Stepper\src/Stepper.h:112:9: error: 'int Stepper::motor_pin_2' is private
int motor_pin_2;
^
sketch_nov24c:18:93: error: within this context
MujMotor::MujMotor(int a, int b, int c, int d, int e):Stepper(number_of_steps, motor_pin_1, motor_pin_2, motor_pin_3, motor_pin_4){
^
In file included from C:\Users\bartv\AppData\Local\Temp\arduino_modified_sketch_4856\sketch_nov24c.ino:1:0:
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Stepper\src/Stepper.h:113:9: error: 'int Stepper::motor_pin_3' is private
int motor_pin_3;
^
sketch_nov24c:18:106: error: within this context
MujMotor::MujMotor(int a, int b, int c, int d, int e):Stepper(number_of_steps, motor_pin_1, motor_pin_2, motor_pin_3, motor_pin_4){
^
In file included from C:\Users\bartv\AppData\Local\Temp\arduino_modified_sketch_4856\sketch_nov24c.ino:1:0:
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Stepper\src/Stepper.h:114:9: error: 'int Stepper::motor_pin_4' is private
int motor_pin_4;
^
sketch_nov24c:18:119: error: within this context
MujMotor::MujMotor(int a, int b, int c, int d, int e):Stepper(number_of_steps, motor_pin_1, motor_pin_2, motor_pin_3, motor_pin_4){
^
exit status 1
within this context
správně to bylo takto:
Kód: Vybrat vše
MujMotor::MujMotor(int number_of_steps, int motor_pin_1, int motor_pin_2, int motor_pin_3, int motor_pin_4):Stepper(number_of_steps, motor_pin_1, motor_pin_2, motor_pin_3, motor_pin_4){
}