Posted: May 28th, 2011 | Author:Vic | Filed under:Uncategorized | Comments Off on Charlieplexing Spreadsheet
3 pins controlling 6 LEDs… pretty neat
In my recent exploration into the realm of Charlieplexed Networks of LEDs, I whipped up a fancy-pants spreadsheet that tells you how many LEDs can be controlled by N pins, which is somewhat unexciting as the answer is just N * (N – 1), which is the simplified form of (N Permute 2). I can only imagine how impressed you are by my mastery of middle school mathematics… I also, in Excel brute force tradition, had the spreadsheet calculate an accompanying table enumerating all the complimentary pairs of HIGH/LOW pin-mapped addresses in the LED network. Is this particularly useful to anyone? Maybe, maybe not, but for me it helped me to see the software side of things a little more clearly. So I figured I’d share this toy spreadsheet with the world via this blog entry.
Basically you wire up a complimentary pair (i.e. facing in opposite directions)Â of LEDs between each pair of pins that you have available, hook up one carefully sized resistor between each pin and the charlieplex network, then use software to turn all but two pins into inputs, and set one of those two HIGH and the other LOW, and that turns on exactly one LED in the network if you set it up right. Using this technique, and exploiting a fundamental weakness of human visual system called Persistance of Vision, you can sequentially illuminate (i.e. scan)Â the LEDs in the network to illuminate (as far as the eye can tell anway) many more LEDs than you have pins. It’s actually remarkably clever once you get your head around it.
Posted: May 26th, 2011 | Author:Vic | Filed under:Repair | Tags:fix, robot | Comments Off on Fixed My Clicking Roomba!
OK, so it’s not like I cured cancer or anything, but, inspired by my pilgrimage to the Maker Faire in San Mateo this past weekend, I saw coming home to a broken Roomba robotic vacuum a welcome challenge. In a nutshell, the symptom being exhibited was the brushes not turning and the brush cage rising and falling at about 1Hz, resulting in a distinctive clicking sound. After a few minutes of this, the robot eventually gave up and announced that I should clean the brushes or something useless like that.
So I asked the almighty Google if it knew anything about this mysterious phenomenon, and, lo and behold, I arrived at this amazingly clear and eminently useful video on the You Tube.
I thought to myself, hm… that’s a lot of small moving parts, but yea sure I can follow that…Â Â so I commenced with the disassembly, diving head first into the belly of the beast. Now I don’t know life is like in @dfraser’s household, but I’ve got two shedding cats and a shedding dog, and a generally dusty house. Having watched the video, I was completely unprepared for what I found when I finally cracked open the gearbox for the brushes. I was, to say the least amazed at the scale of the infiltration. I took some photos as I went, and thought I’d share them here. Hopefully they don’t gross anyone out too much!
Anyway, I cleaned it all up, resorting to a toothpick to clean between the teeth of every gear, applied a fresh coating of synthetic grease to the plastic gears, put it all back together, and…. IT WORKS just like new! I’m not gonna lie, I felt like a legend of robotic vacuum repair for about 15 minutes. The moral of this story is that you’d be surprised what you can fix and do yourself. I frequently hear people express a fear of programming, but for me it’s kind of a fear of the mechanical – screws, washers, and gears are mysterious… but once you dive in and take it apart, it’s really not so scary after all! Now for those gross pictures :).
Happy New Year! I recently decided it was high-time, here at Wicked Device, that we started making some of our “stand alone” products (even more!) accessible to the Arduino community. So for my first trick, I decided to take our Day Counter product and make it easily usable as a general purpose 7-segment display for an Arduino. In the process, I also ended up making a separate library for dealing with the trusty 74HC595 shift register used in the Day Counter project. All I had to do was read the tutorial on the Arduino website, remember how to write C++ classes, and port a bunch of code I had already written for the ATTiny85 for the Day Counter. I was actually really impressed, it wasn’t that hard at all.
The result is some really powerful capabilities for end-users with a neat public interface. Using the new libraries lets users use the Day Counter for whatever they can imagine without having to worry about the details of the Arduino/DayCounter interaction. As a user, all you really want to be able to say is:
I’m using Arduino pins 5, 7, and 10 (or your favorite pins)
This is very clever, using an Arduino UNO to target an ATTiny45 or ATTin85 with a sketch! Watch out for assumptions in Arduino libraries, most notably that the assumption of 16MHz operation. And of course there are clearly limitations in terms of available pins on the smaller device. For what it’s worth, Wicked Device Day Counter kits come with an ATTiny85V and a programming header if you want something a bit more sophisticated than a breadboard to play with :)!
Posted: December 13th, 2010 | Author:Vic | Filed under:Uncategorized | Tags:development, software, tools | Comments Off on Ideone.com | Online IDE & Debugging Tool
Have you ever come across a code snippet you really wanted to try out but you weren’t near a compiler? Believe it or not, that happens to me sometimes. It turns out there is a pretty neat free web-based compiler out there called ideone (i.e. Integrated Development Environment One). It lets you paste code (supports 40 programming languages!) into the browser window, compiles and runs it, and gives you the output. It even syntax highlights it for you.
So it’s a great tool for getting your feet wet in a new language or trying out a code fragment and printf’ing its output. Basically it’s a fun place to hack in a sandbox. I like to use it as a lightweight testing environment during prototyping. Check it out, I figured I’d share the love :).
Posted: December 7th, 2010 | Author:Vic | Filed under:Uncategorized | Tags:Arduino, Hack, USB | Comments Off on Arduino Blog » Blog Archive » USB Hacking with Arduino
Posted: November 15th, 2010 | Author:Vic | Filed under:Uncategorized | Tags:fun, software | Comments Off on Robocode Home
Robocode Home.
I recently stumbled across this really cool way to pass time. It’s basically a “battle bot” simulation environment. You can define your own logic for a robot. Your robot has a “radar,” a “gun,” and a “body.” You can rotate the radar and the gun separately from one another, and move your robot around within the limitations of the environment and its “physics model.” You can write your robot as a Java class (and use Eclipse as your IDE1), or you can use C# .NET if you have some sort of freaky Windows fetish. They give you a bunch of good example robots that do some of the “basic” things you might want to do, like target other robots, evade, and shoot. I recommend reading the Wiki tutorial if you want to get started, I got it all installed and running my own robot class in less than 15 minutes. Hope you find it as entertaining as I do, happy battling!
Posted: October 20th, 2010 | Author:Vic | Filed under:Uncategorized | Comments Off on BattleBricks: MakerLegoBot: The Lego Mindstorms NXT 3D Lego Printer