So I had this wireless motorized tripod head, but I didn't have a infrared remote.
And of course I thought I could get one on eBay, but after hours of searching the internet for one,
I decided I would have to just take out the micro-processor and hook up an Arduino.
And I also decided to swap the IR sensor with Bluetooth for the purpose of using a smartphone.
So I through some code together, and tested it with an old stepper and an Arduino uno, and it worked perfectly.
Then I opened the case of the tripod head, hooked up the stepper, and everything worked just fine except changing speed, I've gone over the code multiple times checking for errors, with no result.
Any help would be appreciated, thanks.
The stepper is a Limit Ming Jong ST30. Picture attaches.
I will be using a Arduino pro mini(which hasn't come in the mail yet.)
Attached is the code(which is somewhat complicated) and a picture of the stepper.
I will be using an optoisolator instead of a relay.
I don't see any evidence of speed change in your code
Seems the code is using serial input to modify the parameters (left, right, stop, RPM).
And: if I am not mistaken, he has to key in 51 to increase the speed; but case 52 is very dubious ...
But the OP should tell us exactly what he intends to do or what he thinks the code should do and what it does / doesn't.
A Bluetooth smartphone will connect to an HC-05 Bluetooth module,
using that as my serial input,
the doing variable is used to tell the stepper which direction to go,
and is changed by two input buttons (so as to not allow the stepper to turn to far) and a serial reading of 49.
The rpm variable is set to the desired rpm of the motor, and will change with the serial read of 51/52.
The maximum rmp value of 75 and the max stepsPerRevolution value of 400 was determined by testing an old stepper for it's max speed, and would be changed to fit the max speed of the one I will be using.
The start_stop variable is used to determine if the stepper should be moving, and will be changed by a serial reading of 50.
The two relays (which willl be switched out for optoisolators) are used to control the camera's shutter through a cable attached to the case, and will be controlled by a serial reading of 53/54.
The default serial reading is for multi-shot and/or bulb mode on the camera.
The reappearing flashing of pin 13 is for alerting when something happens and is useful for debugging any potential Bluetooth connectivity issues.
I have tested the code with an old stepper and worked perfectly.
If you really want help then pls give us a complete picture of your project/configuration/problem.
Otherwise nobody would be interested in wasting more time in here.