I´ve got a problem.
I need a script for the Arduino Nano that takes a up to 5V positive or negative signal of one single wire and converts it into the Dir and Step-Signal in order to control a Nema 17 stepper using a a4988 driver.
Dir is on Pin 2 and Step on pin 3 and VDD and Ground are already used by the driver.
The script should take the one-wire signal, if this is positive, the stepper should turn clockwise, if it's negative the Stepper should turn the opposite direction. The Voltage of the Signal (-5V until 5V) say which speed it should take, 0V means on turn, 5V means Full clockwise, -5V means opposite full. -2.5 half speed and so on.
It would be great if you could help me out with a script.