Pages: [1]   Go Down
Author Topic: Program for Stepper Home positioning  (Read 394 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would it be something like:

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

while(Sensor=0);
}

?
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 167
Safety first.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried experimenting in the Arduino IDE?

This isn't the whole code but it is the logic.
Code:
while(sensorVal != 1)
{
//update sensorVal with a read
//have the motor move a step
}
Logged

Pages: [1]   Go Up
Jump to: