08.40.00 - Mark
I've been on this construction binge this weekend. Like patching that BFH that was keeping my room at sauna like temps, helping a grill stay in one piece a little better, fixing a couple door knobs etc. Nothing really techie, but useful none the less.
Unfortunately I am a techie and I was getting the urge to do something technical. Well while I was working on the doors I was listening to an interview with Paul Graham and he made a comment about Perl being one of the next really cool languages.
This kind of gave my inner geek a warm and tingly sensation since one of the classes I just finished up (Programming and Logic) gave me a quick intro to Perl. Aside from the common usage of the weird key strokes the language requires (most of them do so its pretty much a moot point) I really liked coding but outside of class didn't have a lot to do with it (I know I could go to an OSS project but well umm meh.). The comment also reminded me of a parallel port driver for perl that circulated among some of the blogs I subscribe to a week or so ago.
I'll leave out the list of art/design/gadget blogs that are constantly posting cool digitally controlled light displays, but suffice to say I've drooled over many of the projects.
Anyways. These last tree paragraphs set the stage for my sub-genius project idea.
Giant binary clock.
I'm not entirely sure about the physical aspects of it, like looks, materials, CPU and electronics, but looking at the driver it was pretty easy to tell that I needed the output in mind. Since I wasn't sure perl could do what I wanted I needed to code. So I went out and dug up some decent perl function documents (because while I still have my book on Perl from class, its 5 years old and doesn't cover any of the time functions I needed). After a couple hours of coding and some debugging I had a simple digital binary clock. In the mean time 5AM had snuck up on me
I know it isn't the most effective solution (hours minutes and seconds are all processed in each cycle, I could make it a tighter program if I made the hour and minute conversion increase based on the seconds), but it works and doesn't seem to eat up that much of my processor's cycles (what it does to a P2 or an old desktop mac is yet to be seen) Anyways I'm posting the code for your enjoyment and perusal. Feedback welcome, I'd put in one of those geek friendly OSS licenses, but I'm too lazy to find the one I want.
As noted in the code I'm still cooking up how the hardware portion should work. What kinda of has me is that I only have 8 pins to work with, possibly 9. Avoiding the use of ICs I'm fairly certain that I'll need to use 6 pins to turn on the lights within each column, then use the remaining 2 to change to the other columns. Additionally I need to find a way to make the lights stay on as the program adjusts the other columns. I'm sort of leaning towards a transistor and capacitor solution, but there are some other options out there. I'll research that later. For now I'm happy with my code, especially since its probably easier to read (and comprehend) than this blog post at this point.