I'm here as a helper for my son and maybe learn something along the way for myself. I think he got me hooked on this stuff! Anyways, he needs to write a Arduino code using a stepper motor (28BYJ-48) which is connected to a ULN2003 Stepper Motor Driver Board. There is also a single button used to change direction of the stepper motor. Well, if you see the image below, you can see the setup. The image is showing the setup that was used to determine the max speed of the stepper motor (first assignment) - code below.
Now, he needs to modify the below code, to be able to do three things:
- Perform a "Full Step"
- Step counterclockwise when no button is pressed
- Step clockwise while HOLDING down the pushbutton
He is not allowed to use any functions from the stepper motor library. But there is a hint given: "The ULN2003 grounds whatever output is activated, for example, a 1 is output to Arduino pin 4 which is connected to ULN2003 pin 2B. This causes the ULN2003 pin 2C to go to ground potential thus turning on coil 1b (see Fig. 3)."
We both been putzing around for a while now to no previal and came to the conclusion that we both need help or some advise.
Setup / Connections / Code that needs to be modified:
Appreciate any help with this!