Coming from a design background, I have a hard time understanding how something works or its purpose until I can see it applied to a real life situation. This is how I feel about learning Ruby. While I’m becoming more familiar with the language day by day, I still needed an example of a practical application of it in order to wrap my head around when it’s used.
In order to bring it all together, I decided to turn to an area I have a little bit of know-how in: physical computing. Ever since I was a kid, I’ve wanted to take over the world – and that dream starts by having your very own robot army. While I don’t have a large army to date, I have made a few small models with various microcontrollers, specifically with the ever popular Arduino. But, the Ardunio platform is based on a language (and environment) called Wiring, which is in turn based on C++ – quite a bit different from our pretty happy friend Ruby.
So, I did a bit of research and found that someone had built a gem called dino last year for the exact purpose of running ruby sketches on your Arduino. After installing the dino gem and hooking up the Ardunio, all that was left was to write a simple sketch and watch what happend.
By writing some Ruby and following a few syntax rules dino lays out, you can get an LED blinking in no time. And while this is a little underwhelming, I’m hoping to create more interesting projects with this pairing as I begin to learn more.
Here is the result of that labor (click pic to see Vine video):
Make yourself useful.