Maslkjdoiasudashoidnasd

Hello, I have this code

If I sent 1 to Servo2, servomotor is working fine

Obviously continuousStepper uses timer 1 which is also true for the servo lib. So you have a timer conflict.
Which board are you using?

1 Like

Arduino UNO has only one 16-bit timer.
You could try my MobaTools library. It can drive servos and steppers and uses the same timer for both ( timer 1 on UNO ).

I control my steppers with a driver. Can the code be adapted to what I need?

That goes without saying, there is no other way. Which driver do you use? From your sketch it seems to be a step/dir driver, which is very common.

I don't know what you need. But if it works with ContinuousStepper.h and Servo.h separately, it is very likely that it can be done with MobaTools.
ContinuousStepper can achive higher steprates than MobaTools. But the 200 steps/sec you use is no problem. MobaTools can achive up to 2500 steps/sec on an UNO.

What did you do?

You need to use MobaTools only. MobaTools can control servo and stepper at the same time using only one timer ( timer1 on UNO ).

I don't think so. timer0 and timer2 on UNO are 8-bit timers only. The servo lib needs 16-bit timers. But of course you can try.
I don't know if the ContinuousStepper library can use timer 2.
Be aware that timer 0 is used by the millis() function. It will not work anymore, if you use timer 0 differently.

Topic locked as OP no longer requires help.

@d4rkkkk please see PM. I have restored your deleted posts. Vandalising a topic risks a complete ban from the forum.

Thanks,