Step motor 28BYJ- 48

Hi, I’m new in XOD, and I want to use the step motor. I need that it move and after 40 second it do the opposite movement. Can someone help me with that ? Also I need to see the sketch!
Thank you so much!

Hello and welcome,

How fast do you want it to move?

How far do you want it to move?

A stepper motor runs on steps … Pulses… Not time… A DC motor or AC motor can run on time.

A stepper motor is a precision device… 1 step = 360 degrees / 200 steps… If you use a microstepping drive then 1 step can be very small…

You need to explain what you want to do… In much more detail… What makes the motor start and stop?

You also need to try to do it yourself… Even if you fail… You are at least trying to learn XOD

Hi, I did so many trails. The Motor should rotate of x grades in a verse, it will be activate by a meter sensor( less than 0.2 the pulse is true). When the motor start to move a clock start to count util 40, at 40 the motor should move in the opposite verse and of -x grades.

txgruppi/stepper-28byj48 library has an example that steps every 0.01 seconds and reverses direction every 2.5 seconds. It should give you some ideas of how to get started. You don’t want to keep changing direction, so it is not the solution to your problem.

Try the example & see if it works with your hardware. Then try to modify it to do exactly what you want. If you get stuck, post what you have so far & someone will probably jump in to help. There are probably others like me who are happy to help where we can, but we are not too keen on just writing someone else’s code for them.

Post your .xod and I’ll take a look at it. I’m not sure if I can help you, because I have never tried to use a stepped motor before and I dont own one but I’m pretty good at using time and clock nodes so I might be able to help there.

I’m using that library, but the problem is that the Motor is not working

@andrea-nardone12

I don’t think you are understanding how to use the txgruppu/stepper-28byj48 library.

If you look at the original example there are 2 key components…
NODE: stepper-28byj48-controller
NODE: stepper-28byj48

Also looking at your example you have 2 stepper motors… assigned to the SAME pins…

the NODE stepper-28byj48 requires an input mask to control the output pins. the input mask comes from the NODE: stepper-28byj48-controller

here is my attempt at trying something that may work for you… or allow you to try something to change it:

rangeSensorToStepper.xodball (102 Bytes)