I am newbie in arduino, i try to make macro rail, and i wonder how to make program like this:
Two buttons are move forward and backward, when i decide that is my start position i press 3 button and its remember it as start, then i move forward for eg. 3mm and then press 4 button and this is mine end. When i press 5 button its back to start position and when i press 6 button it goes to the and...
i hope You understand me what i mean, i will be glad for help
I think it would be easier to understand if you provided whatever code you currently
have - or at least some details like which pins are which buttons.
but i dont know how to determine this start and end point
Start and end of what?
Start by including the IR library, and making the sketch simply print "Switch n pressed", where n corresponds to the value on the switch. Then, you can do different things when switch n is pressed. One thing you will need to do is keep track of how many times have been stepped, incrementing or decrementing as appropriate.
First, most IR senders send a different value if key is held down. You need to keep track of the previous value, so when the repeat code arrives, you know what to repeat.
Second, steppers rotate. There is NO concept of left or right. The rotation of the stepper may result in some conversion to linear motion, but we can't see how your steppers are doing that. So, you are on your own figuring out what "move right" means, and making that happen.
how to declare start point and end point now ?
The same way as before. Start and end points have no meaning. Steppers rotate. You might want some number of steps to be recorded when a switch is pressed, but until you start counting how many times you've stepped, you haven't a chance of making that happen.