Go Down

Topic: Program for Stepper Home positioning (Read 542 times) previous topic - next topic

Nihel01

I want to set a Home position for a stepper. I already have a Hall effect sensor and a magnet, I just need the code that will make the stepper rotate until it reads the '1' from the sensor. Can somebody help me please, i'am a bit lost.

Nihel01

Would it be something like:

if(pushbutton = High){
do{
     //stepper moves 1 step//
}

while(Sensor=0);
}

?

Catcher

Have you tried experimenting in the Arduino IDE?

This isn't the whole code but it is the logic.
Code: [Select]

while(sensorVal != 1)
{
//update sensorVal with a read
//have the motor move a step
}

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy