Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is directionPinNumber optional? #50

Open
Haimana opened this issue Dec 6, 2024 · 4 comments
Open

Is directionPinNumber optional? #50

Haimana opened this issue Dec 6, 2024 · 4 comments

Comments

@Haimana
Copy link

Haimana commented Dec 6, 2024

Hello,
I need to control a stepper in a single direction, so no need the directionPinNumber

If only stepPin used, like this:
stepper.connectToPins(stepPin);

I get this message in serial:
E (225545) gpio: gpio_set_level(227): GPIO output gpio_num error

Of course, I can define a directionPin but I'm fully out of available GPIOs because a TFT display with parallel connection which will be difficult to replace for other reasons.
So, not a big deal with that message but the question still remain: will work like this without other issues?

Thank you,
Seb

@pkerspe
Copy link
Owner

pkerspe commented Dec 6, 2024

Can you please post all the code including the initialisation of the variables you use to configure the library?
I am not sure how to reproduce the message you get.
In general it should be doable to easily modify the library to ignore directions. I will check once you posted the whole init / setup routine code part

@pkerspe
Copy link
Owner

pkerspe commented Dec 6, 2024

I had a Quick Look in general into the code and it is fine to not specify a direction pin, default value for this pin will be 255 then, and the library will not set the pinmode in that case.
Not sure though about the error message you posted, when exactly is this one showing?
Maybe some code is missing the check for the 255 value and tries to change directions.

@Haimana
Copy link
Author

Haimana commented Dec 6, 2024

thank you for instant reply
I just placed a scope on the stepPin and it seems there are some more issues by my side so I have a little bit more to dig
I'll report back ASAP

@Haimana
Copy link
Author

Haimana commented Dec 6, 2024

Hello again,

I tried not to involve my old and dirty code so I moved to Arduino IDE and a simplified Example1 code

#include <ESP_FlexyStepper.h>

// IO pin assignments
const int MOTOR_STEP_PIN = 26;
const int MOTOR_DIRECTION_PIN = 2;

// create the stepper motor object
ESP_FlexyStepper stepper;

void setup() 
{
  Serial.begin(115200);
  // connect and configure the stepper motor to its IO pins
  stepper.connectToPins(MOTOR_STEP_PIN); //, MOTOR_DIRECTION_PIN);
}

void loop() 
{
   stepper.setSpeedInStepsPerSecond(800);
  stepper.setAccelerationInStepsPerSecondPerSecond(800);
  stepper.moveRelativeInSteps(2000);
  delay(2000);
}

still getting this error:

E (94272) gpio: gpio_set_level(227): GPIO output gpio_num error
E (101005) gpio: gpio_set_level(227): GPIO output gpio_num error
E (107738) gpio: gpio_set_level(227): GPIO output gpio_num error
E (114471) gpio: gpio_set_level(227): GPIO output gpio_num error
E (121204) gpio: gpio_set_level(227): GPIO output gpio_num error

I tried also with minus, same efect
stepper.moveRelativeInSteps(-2000);

Arduino IDE 2.3.3 and ESP_FlexyStepper 1.5.0.
The device is an old Nodemcu-32s

Thank you,

LE: updated to Arduino IDE 2.3.4, same thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants