Hey guys,
I have finished a long lasting project. It's an automatic fish feeder. After finishing it, I teared appart everything to put it together inside a case. That was not easy.
Now, I have a small problem. ![]()
My stepper seems to move backwards if it should go forword. So maybe I plugged in the cables on the A4988 reverse by accident. It is very difficult to get them out now as you can see on the pictures.
So my idea is, to use the stepper.setPinsInverted command to do the job.
Does anyone know the roots of this command?
I still use the command in my code but I do not know the effects cause that part of the code was an example from somewhere else.
At the moment the command in my void setup() looks like this:
void setup() {
Serial.begin(115200);
servoMotor.attach(SERVO_PIN); // attaches the servo on ESP32 pin
lightInit = analogRead(sensorPin);
Serial.println(lightInit);
pinMode(onoffpin, OUTPUT);
digitalWrite(onoffpin, LOW);
pinMode(buttonPin, INPUT); //initialize the pushbutton pin as an input
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, HIGH);
stepper.setPinsInverted(false, false, true);
stepper.setEnablePin(25);
pinMode(MS1, OUTPUT);
pinMode(MS2, OUTPUT);
pinMode(MS3, OUTPUT);
digitalWrite(MS1, HIGH);
digitalWrite(MS2, HIGH);
digitalWrite(MS3, HIGH);
Maybe someone can help me. I want to avoid again tear appart the finished case. ![]()
The pictures are just to illustrate the whole project. ![]()


