creating libraries

hi All
i have been plugging away trying to learn programming with arduino and have learned a lot but im kind of stuck now
i found a simple acceleration sketch for stepper motors and i really like the way it works and the simplicity of use, so i am trying to create a library to use on multiple steppers each with a few different parameters with each call to the function (steps)
I keep getting errors when trying to verify and am not sure all the syntax and variables are in the proper places
I know its a lot and a really big mess but any help would be great

here is the sketch calling the function to move 6000 steps
im not sure if im declaring it properly or missing key parts

int steps = 6000;
 byte step_Pin = 3;


stepper_Accel cell_Pickup = stepper_Accel(steps, step_Pin);
 
void setup() {
     pinMode(step_Pin, OUTPUT);
}


void loop() {

 cell_Pickup.simple_Accel(steps, step_Pin); 
 

}

*this is a copy of the source file again im not really sure it is proper

// Source file

#include "arduino.h"
#include "accel.h"

stepper_Accel::stepper_Accel(int steps, byte step_Pin) {

    _steps = steps;
    _step_Pin = step_Pin;
    
}

void stepper_Accel::simple_Accel(void) {

  
  int lowSpeed = 2000;                                  // Adjust for lowest speed 
  int highSpeed = 300;                                  // Highest speed is 200 with 400 steps per revolution
  int change = 2;

  int rampUpStop = (lowSpeed - highSpeed) / change;
       if ( rampUpStop > _steps / 2 )
            rampUpStop = _steps / 2;
  int rampDownStart = _steps - rampUpStop;

  int d = lowSpeed;

  for (int i = 0; i < _steps; i++) {
    digitalWrite(_step_PIN, HIGH);
    digitalWrite(_step_PIN, LOW);
    delayMicroseconds(d);

    if ( i < rampUpStop )
      d -= change;
    else if ( i > rampDownStart )
      d += change;
  } // close for loop
  
} // close function
  • And here is a copy of the header file
// Header file


#ifndef accel_h
#define accel_h

#include "Arduino.h"

class stepper_Accel {

  private:
    int _steps;
    byte _step_Pin;
    

  public:
    
    stepper_Accel(int steps, byte step_Pin);
    void simple_Accel(void);

};
#endif

Can you post the errors?

In the cpp file it says
_step_Pin was not declared in this scope

sorry i opened up the errors and all this was in there too

sketch\accel.cpp: In member function 'void stepper_Accel::simple_Accel()':

accel.cpp:28:18: error: '_step_PIN' was not declared in this scope

digitalWrite(_step_PIN, HIGH);

^~~~~~~~~

sketch\accel.cpp:28:18: note: suggested alternative: '_step_Pin'

digitalWrite(_step_PIN, HIGH);

^~~~~~~~~

_step_Pin

steps:6:1: error: 'stepper_Accel' does not name a type

stepper_Accel cell_Pickup = stepper_Accel(steps, step_Pin);

^~~~~~~~~~~~~

C:\Users\window\Desktop\arduino sketches\steps\steps.ino: In function 'void loop()':

steps:15:2: error: 'cell_Pickup' was not declared in this scope

cell_Pickup.simple_Accel(steps, step_Pin);

^~~~~~~~~~~

exit status 1
'_step_PIN' was not declared in this scope

as indicated in the errors........

for (int i = 0; i < _steps; i++) {
digitalWrite(_step_PIN, HIGH);
digitalWrite(_step_PIN, LOW);
delayMicroseconds(d);

_step_PIN should be _step_Pin !!

Of course it is
Its always something like that
I guess thats a lesson in using the same naming conventions
Thanks very much