Stepper Motor question

hi I am hoping someone can help me here I am very new to all this stuff and for a project I want to build an arduino controlled 3 axis cnc machine how ever I have connected a single motor to a driver and used a small piece of test scrpt to get the motor to rotate but it keeps stalling and just vibrating. I have come across some information about it being to do eith the frequency but im getting lost on what I need to do any help would be great.

Motor: NEMA 23
Driver: CW5045
Arduin mega

and here is the code I used.

const int pul = 7; //set pulse at pin 7
const int dir = 4; //set direction at pin 4

void setup() {
Serial.begin(9600);
pinMode(pul, OUTPUT);
pinMode(dir, OUTPUT);
}

void loop(){
digitalWrite(dir, HIGH);
digitalWrite(pul, HIGH);
delayMicroseconds(10);
}

@martin-riddell, I am asking the Moderator to move your question to its own Thread as it is a separate project from my Tutorial.

Please provide a link to the datasheet for your stepper motors and for the stepper motor drivers you are using.

Please tell us what motor power supply you are using - volts and amps.

And please use the code button </> so your code looks like this and is easy to copy to a text editor

...R

Assuming that your wiring etc. is all correct, the sketch will do just one step because your step pin is toggled from LOW to HIGH just one time.

Try to set the pul pin to LOW after the delay command (digitalWrite(pul, LOW))

First thing to do is get the AccelStepper library and use the DRIVER option for a step/direction
stepper controller, as in

#include <AccelStepper.h>

AccelStepper my_stepper (AccelStepper::DRIVER, pul, dir) ;

void setup()
{
  my_stepper.setMaxSpeed (100) ;
  my_stepper.setAcceleration (1000) ;
}

Then you can play with various speeds and accelerations and find the limits for your set-up.

However if you tell us full details of the hardware we can see if there are any issues there too...