hey guys i want to start my stepmotor with a push button but i dont know who to declare the stepmotor as the output. i want that when i push the button the step motor starts, wait a second, and then go back in the position like before
thx for help
hey guys i want to start my stepmotor with a push button but i dont know who to declare the stepmotor as the output.
Exactly like you do when there is no push button involved.
i want that when i push the button the step motor starts, wait a second, and then go back in the position like before
One time? Every time?
Stepper motors step. They don't start. They know nothing about waiting.
You can write code that reads the state of a switch, and, if that switch transitions to pressed (which is not the same as "is pressed"), then perform some action(s).
The action(s) can involve stepping a motor some number of steps, stepping a motor repeatedly, until some amount of time has passed, stepping a motor repeatedly until some other condition is true (a limit switch was pressed, etc.), twiddling thumbs (delay(1000);), etc.
It isn't clear exactly what you have working now, or what you need help with.
the stepmotor has 4 pins so i dont know which one to declare as output
the stepmotor has 4 pins so i dont know which one to declare as output
This implies that you don't really know anything about how to drive the stepper motor at all. Do you?
What kind of stepper motor is it? 99.9% of stepper motors draw far too much current for the Arduino to drive directly. So, generally, some kind of shield is needed. The Arduino then simply tells the shield that the motor needs to step, one way or the other. The shield then energizes the correct fields on the stepper motor, in the correct order (assuming that the motor is connected correctly) to make the motor step once.
well the problem is that the arduino is topic of our science couse but we dont learnden so much as we needed. so yes i am not the pro in arduino software. so theres no possibilitie to do this without a shield? does the shield take the 4 pins to one which i can declare as the output?
ty for your help guy
blackhiden:
well the problem is that the arduino is topic of our science couse but we dont learnden so much as we needed. so yes i am not the pro in arduino software. so theres no possibilitie to do this without a shield? does the shield take the 4 pins to one which i can declare as the output?
ty for your help guy
You haven't told us what server so how are we supposed to know?
You're trying to simplify something that isn't that simple. You can't just "turn an output on" to drive it. You should probably spend some time learning about how steppers work and how they are driven.
so theres no possibilitie to do this without a shield?
It is possible to drive a stepper motor without a shield. All that is really needed is a collection of transistors and an external power supply. The transistors are wired to the coils of the stepper motor, so that turning one transistor on at a time causes the stepper to step once. The power to drive the stepper motor then comes from the external power supply, not the Arduino.
does the shield take the 4 pins to one which i can declare as the output?
No, the shield takes two Arduino pins - one for direction and one for stepping. The connection between the shield and the motor depends on the shield, but is designed to manage the complexity of exciting the correct coil, based on the direction to move, and the currently excited coil.
thank you for your answer. well the motor works and its all ok but everyting i wanna know is if i can start the step motor by pushing the button and when how to programm it . ty for your patience
well the motor works and its all ok
What motor? How is it connected? What code is running on the Arduino?
i wanna know is if i can start the step motor by pushing the button
Re-read reply #1. Yes, you can.
and when how to programm it
When would be sometime soon. How depends on what pin the switch is connected to, how the switch is connected to the pin, and exactly what you want to have happen when the switch is determined to be pressed (and whether "is pressed" is sufficient, or if "has just been pressed" is necessary).
There is a difference between determining that a switch is pressed and determining that a switch is pressed this time, but was, or was not, pressed last time.
You need to be much clearer on your requirements.
ok. i've got the arduino duemmilanove w ATmega 328 board. the motor is out of an cd drive and the motor driver is the L293DNE. and i want that if i push the button, the motor starts. then afer a few steps it shoul stop, wait a second and go back.
Re-read Reply #8. Specifically, count the number of questions. Count the number of answers you provided. They do not match.
OP. I've removed the last few posts of pointless discourse.
Perhaps if you answer the rest of PaulS's questions, we can move on.