Katy managed to pick up some IR LEDs from Maplin when she was home over the weekend for me. After successfully blowing up two of the few seven I had I succeeded in creating an ‘IR pen’ - i.e: an empty biro with an LED and a resistor soldered together inside.
Now I have a constant, non-flashing, IR source (but still without my second stepper motor) I can start building the second part of my project - the pan/tilt mount. Using the processing code I developed in my Zoom Phase (a hacked apart IDEO project, this one in fact) I made a make-shift pan rig. I mounted a HandyCam and the WiiMote to the top - professionally with sellotape - and recorded a Point of View video of how it looks. The result is somewhat jerky but it’s definite proof that the system can work (and in fact only needs a bit of dampening). Yay.
Below is a photograph of the setup (minus a WiiMote, well, it’s there but not attached as I’d dismantled it all to downlaod the video from the camera before I thought to photograph it - silly me).

I’m still not entirely sure how I’m going to build the entire pan/tilt unit nor am I sure if the motors will be strong enough. I may be spending a day in the Product Design studios tomorrow…
Talking to a stepper motor via serial
Today’s major goal of the day was to be controlling the motion of a stepper motor from the computer, preferably in Processing, thus completing the path from detection (WiiMote) to physical movement (motors) - theoretically.
I have been successful to an extent; I can control the motor from Processing - great - but not in the way I would have liked. I was aiming to be able to explicitly tell the motor to turn X number of steps and for it to unquestiongly to oblige. My downfall was serial communication…
Serial communication sends information bit by bit; as an example let’s say Iw as sending the value of 100 to the stepper motor, which on a 100 step motor should mean one complete turn. The numebr 100 is in fact three seperate bits, a 1 a 0 and another 0. The Arduino would read the first character and act, then the second and so forth. This meant that rather than one complete turn my motor was in fact moving just one step (1 step followed by 0 steps and then another 0 step). Disaster.
In a bid to try and outsmart it I wrote all sorts of loops and other clever coding bits to try and catch all the values and then apply it to the motor - all failed.
However, I have now realised that in practice I will likely not need that sort of precision. As everything happens so fast the changes between tracked points will be small so single digit values are probably going to be ok.
A little more thinking led me on to consider these serial values as ‘speeds’ and I would actually hard code the steps into the Arduino code. The theory this time is that I can constantly tell the motor to turn (say) to the right at speed 3 for as long as I transmit the number 3 on the serial port.
So imagine, if you will, that I have 7 speeds; 1-3 are clockwise speeds, 4 is stopped and 5-7 are anti clockwise speeds. The setup could have a sensitivity/speed setting which is customisable in the code on the computer - leaving me in the ideal situation where the Arduino is an interface and not actually doing much thinking for itself.
So far so good. Zoom phase seems definitely focused on getting the concept working.
WiiMote + MacBook = :)
Well, today was a success. I have now got the wiimote connecting via Bluetooth to my MacBook and it’s all happening in Processing. This is ultra cool as before all the connections were happening through compiled applications meaning that I was unable to script custom code easily without some level of hacking; but now I have script access to it meaning I can pull data from the sensors efficiently and easily.
Most of what I achieved today was from tearing apart the source files of an IDEO wiimote project. If you already weren’t so high in my estimations, IDEO, I’d place you higher!
Anyway, I’m hoping I’ve not spoken too soon as I am still a VERY long way from being anywhere near a prototyping stage. That’s all still to come.
At least I can now work in my preferred way; with code!