Hot Motor

Hello and Good day
I am doing an arduino project with a nerma 17 engine.
More or less at 3 or 2 minutes of working the engine is running too hot
Any idea to help me, the program at the moment is based on an ultrasonic sensor that activates the motor by proximity

The Sketch

#define V 1700
#define Echo 4
#define Trig 5
int reset = 6;
int direccion = 3;
int steps = 2;
int pasos = 100;
long S, X;

void setup() {
Serial.begin (9600);
pinMode(Echo, INPUT);
pinMode(Trig, OUTPUT);{
pinMode(steps, OUTPUT);
pinMode(direccion, OUTPUT);
}
}
void loop() {
digitalWrite(Trig, LOW);
delayMicroseconds(2);
digitalWrite(Trig, HIGH);
delayMicroseconds(100);
digitalWrite(Trig, LOW);

S = pulseIn(Echo, HIGH);
X = (S/2)/29;
delayMicroseconds(500);

if (X <= 10 && X >= 1){
Serial.println(“OBJECTE_DETECTAT”);

digitalWrite(reset, LOW);
delay(100);
digitalWrite(reset, HIGH);
digitalWrite(direccion, HIGH);

for (int i = 0; i<pasos; i++)
{
digitalWrite(steps, HIGH);
digitalWrite(steps, LOW);
delayMicroseconds(V);
}
digitalWrite(reset, LOW);
delay(100);
digitalWrite(reset, HIGH);
digitalWrite(direccion, LOW);
delay(1000);

for (int i = 0; i<pasos; i++)
{
digitalWrite(steps, LOW);
digitalWrite(steps, HIGH);
delayMicroseconds(V);
}
}
else {
Serial.print(X);
Serial.println(“cm”);
if (X >= 500 || X <= 0){
}
delay(500);
}
}

I saw the forum translates some words like
HIGH = ALTA/O
LOW = BAIXA/0
INPUT = ENTRADA
OUTPUT = SORTIDA

Thanks for all

912:
More or less at 3 or 2 minutes of working the engine is running too hot

Nothing in your program code will cause the motor to overheat.

First, stepper motors are designed to run hot - a temperature that is uncomfortable to touch is quite common.

If the motor is genuinely running too hot then the cause will be an incorrect (too high) current setting on your stepper motor driver. Make sure that the current setting does not exceed the specification for the motor.

If you need more help please post a link to the datasheet for your motor, please tell us what stepper motor driver you are using and please give details of your stepper motor power supply (volts and amps).

...R
Simple Stepper Code
simple acceleration code

Im using a AC/DC adaptor of 12v to 12v 5v 1A, and the longruner a4988
I think the problem might be the fact that I have not adjusted correctly the thread that the longruner had
Is this possible?

The Pololu page on the A4988 has instructions and a video showing how to adjust the driver coil current limit.

Ok, Thanks
im chenking it right now

912:
Im using a AC/DC adaptor of 12v to 12v 5v 1A

Are you sure?
12V AC to both 12V & 5V DC?
1A single or combined max current output?