Hallo,
I'd like to home a stepper motor at startup. How would I do this? using the 4 stepper code.
Thanks,
Adriaan
Home a stepper
Re: Home a stepper
Hello adriaan,
we already talk about that in this topic :https://forum.arpschuino.fr/viewtopic.php?t=17
Ok it's in french...
You need to use an end stop switch like this one for example : https://cdn03.plentymarkets.com/ioseuwg ... -23987.png
Attach it on a free I/O.
initialise it in the setup :
still in the setup, after initializing the stepper motor and before initializing DMX:
the stepper will turn until the switch is pressed, then it will stop at position 0;
Then it will listen to the DMX instructions.
we already talk about that in this topic :https://forum.arpschuino.fr/viewtopic.php?t=17
Ok it's in french...
You need to use an end stop switch like this one for example : https://cdn03.plentymarkets.com/ioseuwg ... -23987.png
Attach it on a free I/O.
Code : Tout sélectionner
uint8_t zeroSwitch=Arp2;
Code : Tout sélectionner
pinMode(zeroSwitch, INPUT_PULLUP);
Code : Tout sélectionner
stepper0.refresh(255, 30);//we define a direction of rotation (255, to go in the other direction : 0), and a speed (here 30 for a slow speed)
while (digitalRead(zeroSwitch))//as long as the limit switch is not pressed ((! zeroSwitch) reverses the behavior)
{
stepper0.continuous();//turn !
}
Then it will listen to the DMX instructions.