So this is what it’s gonna look like?

I sure hope so.
On the right side, featuring 4 LED buttons and a jogger, you can see the remote sending unit - -

I sure hope so.
On the right side, featuring 4 LED buttons and a jogger, you can see the remote sending unit - -
It’s so much fun to go from this:

To this:

The circuits are finished, and both have a nice backside :-)

Next stop CNC to create and test the casing.
Updates soon.
…I hope…
Moving forward: the receiving end incl. Nano, Xbee, and the EasyDriver. It’s just construction now. No small matter though :-)
- - that It’s done. Wireless stepper motor, optical encoder Follow Focus with lens calibration and user controlled speed.

After all these months of not having a minute to finish this, I was quite intimidated by my own project… Seriously. But all the parts arrived and I had a few hours and I looked at my code again and things began falling into place again, and I could (contrary to all my fears) figure out all that I’ve done up until my (too long) break.
And so I’ve added the lens calibration function, and soldered and tinkered with my lipo rider to get it to like my battery and now it actually works.
I hope to find a few more minutes next week to clean up the code, and then it’s packaging time: finishing the design of the various parts, 3d printing prototypes, blah blah blah…
(I do have a small itch, and that is to add a circular LED ring around the optical encoder, just to make things even more refined and friendly, but this will again take more time. Should I…?)

Almost everything I need to finish my project has arrived by mail. Only waiting for 2nd Liporider, and yes — would love to be able to mail order some extra time…
The parts stare at me and wait…
Oh, the daily silly, stupid, dumb, foolish, rash, erroneous stuff I do when trying to find my arms and legs in this field which is still fairly new to me.
I thought I should share the various embarrassing things I do and surely will repeat simply because — it’s OK. I keep telling myself it’s all a major part of learning, and most of a the time - except for hitting my forehead with my hand and sounding the all familiar Homer sound signalling frustration at myself - I just crawl out of the other side just a bit more experienced.
So here’s a short list which will no doubt grow in time:
Since this library (AccelStepper) is nothing short of amazing, writing the code turned out to be quite a breeze.
I’m still no contestant for the most stylistically inclined coder so be warned. Still, I think I’m getting better at this…
Next stop - wireless which is quite messy. Previous prototype had values of up to 180 sent over Xbee; no problem for a simple byte sized Serial.write. This time I need 2 bytes and I’m going deeper into the bitwise operation. I wrote I kind of liked it, right? Now it seems to get back at me with a vengeance…
Anyway - here’s the code…
Update:
Things are looking good. Every minute I’m able to steal is dedicated to working the code. Another library is included (oneButton) to simplify the button operations and it seems to be working fine. I had to edit the lib itself for some timing issues and it feels responsive and good. I’m also refining my style, using function, cases and Booleans in a more elegant way.
One other thing I’ll need to add to my vocabulary is the “sleep” function and usage of pins for the stepper. This will make the unit save more power as well as not get too hot. Came across this guy’s blog and hope to figure out this function and implement it.
Here’s where the code is now:
People can be so great. Have you heard about bildr.org? You should visit this great blog if you find arduino interesting.
So what’s my point?
Researching optical encoder, arduino and stepper, I came across bildr’s tutorial “Rotary Encoders and Arduino”. I figured out some things thanks to that post, and was left with some new - more refined - questions. I happily posted my questions there, specifically wondering if there is a way to create a modified “knob sketch” using a stepper and an optical. Soon enough I was answered by Adam, who happens to be the founder of bildr, saying that this seems like an interesting query, and that my project seems interesting enough and well —- “awesome” — so he’d gladly help. Is this great and awesome, or what? e mail correspondence ensued and I was delighted to learn of a library called AccelStepper that helped me get to the desired goal, as is visible in the video.
The code is fairly simple once you understand that steppers are so much different than servos. I admit I had to check, recheck, ask, research until I finally figured what the hell was going on there. But that’s what friends are for, right? :)
I’m posting the code and finishing this with 3 important notes:
1. I had to push up the baud rate or else Serial.print delayed the hell out of the motor. Serial.print will be replaced with Serial.write for the Xbee, and so had to be checked early on.
2. Check out the void updateEncoder() function. This is the first time I understood what all the “bitwise operators” talk actually means, and I find it simply beautiful…
3. I will now proceed with the implementation of the various modes for the follow focus. I suspect I’ll have some issues and problems along the way, but otherwise there would be no sense of accomplishment, right?
One optical encoder

One stepper motor

One easydriver

And a whole lot of mess.

Am I really back to square one?