Weekend Arduino Projects – 4 Ways to “hello world!”
Sooo it’s been a looooong time since I last posted and there have been reasons but honestly, let’s not get into them and just move on to what this post (actually written a couple months ago) is really about.
Warning: this post deals primarily with subjects that by all rights can be called ‘Nerdy as hell.’ Should such material be known to you as dull, boring, somnolent etc. stop now; It’s not worth it.
Onwards!
So recently I’ve been toying around with the idea of physical computing and trying to figure out something to do as a sort of introduction to the whole field before I begin my fully-functional-hexapod-computer-case-mod project (more details see here) There are quite literally hundreds of ways to start out but quite a few of them involve large-ish sums of money up front which doesn’t sound like my kind of dabbling… then: Lo! The Arduino came unto me and bestowed tidings of great joy which shall be to all people!

The Arduino is an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. Best of all you can have one and start playing with it for as little as $11.50 (although I opted for the pre-built version with a bit more functionality for $33.00 from my new friends at Sparkfun.) For a dabbler like me it’s perfect :)
Arduino Diecimila in hand I needed a project. Although I had originally aspired to replace the brain in my lovely roomba with the arduino it turns out my roomba was made 6 days BEFORE the i-robot folks implemented their current control scheme. Well boooo (all is not lost though, I have a hardware upgrade for it in the mail which will unlock all of the ROI goodness)
Having previously been a software guy my first idea was to make it say “hello world!”

For those of you who are not “software guys” the FIRST thing that every programmer does in ANY language when they start is make it print out “hello world!” If you want to have good crops and win your wars you offer up a slaughtered goat or virgin. If you want to learn a programming language you make it say “hello world!” This is the way things have been, are, and will always be, as they have been handed down from the ancients and we are not worthy enough to contest these points. Deal.
But here’s the first problem: physical computing doesn’t have a screen… there are no pop-up windows… no command line… just a bunch of pins that can can read inputs or give outputs… so a blinking or PWM fading LED it is .
So that’s done.
Well that’s damn boring… and I still have a MIGHTY need for “hello world” if only somebody had made up a form of communication that relied on a blinking thing… and MonkeyMorse was born. Quite a simple and not terribly well written program it takes in a string and translates it to morse code and blinks it out. NOW we’re getting somewhere :) (Code Here) First string up: hello world!
So after an implementation of serial communications hello world (Walkthough here) I figured it was time to do something from scratch… the only problem is that I still only had LEDs lying around… and other than making a Knight Rider mod for my car there didn’t seem to be a lot to do with them… until I found PoV.
The basic idea for this project is that if you take an array of LEDs (I have 10 of them) and make them blink while waving them back and forth it will produce an image in the viewer’s eye for a split second. Should that image be the long desired “hello world” so much the better.
As the Arduino has limited processing ability and I wanted the program to switch on and off the LEDs as fast as possible I opted to encode the message BEFORE uploading it to the chip. A decent bit of Matlabbing later and voila! a program to do just that (windows32 standalone program download here) You simply give it a bit of text, point it at a character set (just a bunch of BMPs) and hit go and it does all the work. Additionally: if needed it can be pointed at a bitmap file and instead of doing text it’ll convert the image into code for the MPoV system. Here it is in action:
Moving on: the chip code simply runs though the sequence of bits sent by the converter program and displays them on the LEDs much the same way the signal gets to your TV screen (except that it is essentially sideways and the motion of the board is the major scan direction) The hardware code is also available: MPoV Hardware Code
And the big finish!
…
…
…
Awwwwww…. not as big as I had hoped….
Of note when working with chips and such with on-board hardware: You have VERY limited resources. I’m talking VERY limited. So limited in fact that my lovely 1100 1s and 0s do not actually fit into the memory space. So it can’t be loaded into memory all at one time. A handful of options exist:
- lower the resolution – Fewer bits = smaller message.
- Stream the data and get into memory management – Smaller chunks at a time streamed into the processor over a serial connection.
- Load smaller pieces of the data and possibly make them off of other memory locations – There is a bit of system memory “off to the side” that I might be able to use but this is a little more extreme than I had planned.
- Just deal with “HiWld!” – Can do RIGHT now.
As you may well have guessed, I went with option 4.
Unfortunately in my glee over a (mostly) working hello world program I failed to actually capture an image of the working final project (and as “Hello World” is supposed to be a quick exercise I’m not going to re-wire it) However I do have this one from a test I ran:

So there you have it. Four ways to hello world and a good deal of fun for an inexpensive-get-your-toes-wet-weekend project. Stay tuned for more madness!
Filed under: Engineering, Gadgetry, Sleep Deprivation on July 27th, 2008
Y’know, calling out your excel nerdery was not, in fact, a veiled challenge, there for you to overcome… but, uh, congratulations anyway! : )
This is , by the way, an AWESOME weekend project! (Way more fun than mine – I tried to construct a waterproof wallet for ID, cash and keys (for to carry these things while snorkeling) out of cling wrap and duct tap. Epic Fail.) Hooray for proto robots!
If/When I graduate from lawschool, I’m going to need an as yet to be determined message embedded in my grad cap. On that day, I will look to you. Stand ready.
Totally nerdy… and absolutely AWESOME.