Archive for September 2008
Man, i thought heredocs were the weirdest PHP construct. I accept them for what they are and do I use them. I’m not afraid of them, but I thought they were yet another weirdass PHP thing. Nope, turns out they’re not. Learn something new every day. Oh, wait, what the hell is this nowdoc thing? I guess that’s two new things for today.
I’m working on my arduino project box, specifically the wiring. I ran into a really strange problem. Strange to me until I thought about it, and then I realized how not-strange it is.
I had wired up a lot of mini / micro switches to various things on the panel of a big project I’m working on for fun. The problem is that all of my toggle switches were working backwards to my expectations. (If you’re reading this and have already learned this lesson, you know where we’re going. )
I wired things up to what I thought would be a logical way. Wire this to that, just like the slide switches I’d also been using without incident.
Then I had my epiphany about how these toggle switches work. I tried to imagine cutting one in half to visualize how they worked based on the scientific research that had been forced on me. My slide switches work great, but my toggle switches are all working backwards.
Aha, so based on what would now make a lot of sense, if I wanted to have my switches indicate directionality on my panel, I would need to switch how they’re wired on the back of the panel in order to emulate the behavior I want!
And now, look at that. Switching the wires will in fact give me the results I had originally intended, even though it seems like a trick I have to pull on my brain in order to get it to do what I want. Not really, but.. without being able to actually see inside the switch, visually it looks like the opposite of what made sense.
Sooo… yeah, now I have a lot of clean up work to do on my project. Recut and strip a bunch of wires, desolder and remove a bunch of work I’ve already done… sigh… Oh well. Such is the price of Doing It Yourself. my hard lesson learned will hopefully translate into less of a mystery for you.