I don’t think we talk about failure enough. Sure, everyone says “you have to fail, it is the best way to learn” but not one likes to talk about it.
I thought about sharing a big failure story but I think, in the end, I’m not going to because it is also sad.
Still, I can’t just close this and tuck it into my drafts folder (that is a scary and slightly hilarious place) so I’ll tell you about this thing I thought “I’ll just hack that together while I’ve got free time”.
I made those motor boards (and I’m not ready to launch myself in to working on my posture shirt (though I probably should)). And I’m waiting for more hardware to make another ayok widget. But I do have the little dog stuffed animal, now with an RGB LED.
What if it could snore? Or sort of breath? Or have a heartbeat? Not for the ayok feature, just because it can be really comforting to be near something that is alive-ish and has no expectations. (I have real dogs, they have expectations. And my beagle thinks I’m stupid so that really helps my ego.)
Anyway, I got the idea, have the hardware, and thought it would make a cute little demo. I also have this thought of trying to use the coin cells to con my hand into believing it touched something (briefly).
I went for the Arduino so I could post it on github, write about it a bit. I had a slight plan to show the result to someone, but not a solid thing.
I coded up a little command interpreter for Arduino’s serial port. Then I played with PWM, discovering that the timer configuration is annoyingly nontrivial. I was surprised as Electric Imp and mbed both hide the guts of PWM. I read timer sections of the ATmega328 datasheet, remembering how much I prefer other companies’ method of information organization.
I made commands for changing the duty cycle and the frequency. I make a little script parser so I could have a snore be inhale, snork, pause, exhale, pause, changing the duty cycle and frequency for each stage.
But it didn’t work that well. The snore wasn’t all that consistent and the code freaked out sometimes. I fixed the freak-out by modifying my PWM code to use the overflow interrupt to reload the registers. But it still wasn’t good.
And then my computer’s screen started acting really strangely, strangely in time with the PWM going on and off. I had the Arduino and motor board powered from my USB port. The motor only takes ~0.5A and the Arduino isn’t a big load. Maybe it was just how dirty the power got. Or maybe it was completely unrelated.
That was the last straw. My results weren’t good. The processor was more annoying to use than I expected. My end goal is fuzzy (and not in a cute-fuzzy sort of way).
Motivating myself to do these projects requires me to like the project. Sure, there were times when the ayok widget was less than fun, debugging can be a grind. But this was just a mess all over. The most fun I had was with the command line parser.
I could persist through this, maybe make something I don’t hate. Probably switch to an mbed to drive it, use a USB hub or external power, maybe get a selection of small motors. But I don’t really want to.
The failure here is not in stopping. The failure is that I’m not learning anything.
I know that with the right motor and PWM tuning I can get snoring working (I’ve done it before). I’m confident heartbeat isn’t tough. And I’m pretty sure I won’t be able to make a determination on my haptic hand-touching-wall thing because it won’t work and I won’t know whether to blame the mounting or the code or the unreality of the situation.
So, it is a little fail and, accordingly, a little depressing.
And I’m not sure what I’m going to do next. I’m hoping to get a contract soon (maybe today, we’ll see). But I’m also borrowing a BeagleBone Black because I’ve been wanting to try it out. I don’t know what my plan is with that. I’ve also been pondering putting ucLinux on a Cortex-M3 devkit (NXP or ST? Or something else?). It is always nice to see how OSs go on processors. I could compare it to FreeRTOS or some of the other small OSs. Build up a library of what’s good for what. But that sounds soooo boring.
Without a goal, I am far more likely to get discouraged.