Teensy, Stepper motor and WS2812 LED interfacing

Hey there,

I am interfacing WS2812 addressable led using the WS2812Serial.h . and driving stepper motor using one of the examples of blink without delay.

   unsigned long currentMillis = millis();
    if (currentMillis - previousMillis >= interval) {
      previousMillis = currentMillis;

      if (stepPinState == LOW) {
        stepPinState = HIGH;
      }
      else {
        stepPinState = LOW;
      }
        digitalWrite(stepPin_cb1_1, stepPinState);
        digitalWrite(stepPin_cb1_2, stepPinState);

    }

in the loop, i am calling both functions

 FastLED.show();
 Drive_motors();

However, the problem is the speed of the stepper motor, it is rotating very slowly after adding the entire block of LED code.

Thank you for the reading,
I am accepting every suggestion here.

Thanks for the help.

It appears the problem is not in the code snippets you provided. Please post your entire sketch and a description of what you intend for your sketch to do.

If the API calls for many LEDs are the cause of the slowdown, maybe direct port manipulation will decrease that time...
https://idyl.io/arduino/how-to/manipulate-arduino-ports/

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.