I am thinking of making a standard reset point for something moved by a stepper motor.
One way (suggestions?) would be to take the 3V3 signal output from the Mega 2560 and make a circuit that is complete when the motor reaches the reset point. Then the 3V3 signal is fed to the A0 pin on the board, which is read in the code - triggering the reset.
I understand that frying the chip is a danger, so a 3kOhm resistor is in the series circuit (3.3V = 1.1mA).
I must confess I don't really understand what you mean by "reset"... return to start?
Why not just use a limit switch which the moved object bumps. The logic looks for that switch to be high or low, whichever, and sends the motor back to the beginning. Need to think thru how the logic will handle the facty that the switch will clear when the object has moved away a bit.
bpietras:
One way (suggestions?) would be to take the 3V3 signal output from the Mega 2560 and make a circuit that is complete when the motor reaches the reset point. Then the 3V3 signal is fed to the A0 pin on the board, which is read in the code - triggering the reset.
I think what you describe is usually called a 'home switch'.
The analog inputs are relatively slow to read. I would use a digital input.
When you have a switch connected to a digital input, use a pull-up resistor on the input and connect the switch between the input and Ground. You can use the internal pull-up to save components: pinMode(switchPin, INPUT_PULLUP)