Hacking a HexBug Robot

I found one of these little HEXBUG Hexbug Spider (colors may vary) on Amazon and thought it might be fun to try and hook an Arduino up to it.  It’s about the size of a fist and is controlled by an infrared remote control.

The robot’s movement is controlled by two small servos .  The first servo causes the top of the robot to rotate 360 degrees without moving the feet.  The second servo causes the legs to move.  The legs are mechanically linked to the top of the robot in such a way that the robot will always walk in the direction that the top of the robot is facing.

Here’s a video of my hacked HexBug in action:

After opening up the robot I was able to use a multimeter to probe the leads running up to the motors and determine that they’re operating at about 3.3v.  Since the Arduino Nano’s digital IO pins are 3.3v when high it made this a really simple project.

Parts List:

Wiring Schematic:

SpiderBotSchematic

Note that the RXD line on the Bluetooth Shield is connect to TXD on the arduino, and TX goes to RX. I wasn’t able to pair with the device for quite some time, and eventually the person I was pairing with figured out I wired that up backwards.

The code I wrote to control everything is available on GitHub.

Leave the first comment

Traffic Light Build Indicator

Continuous integration is great, but it’s only as effective as the visibility of the build status.  You can use things like email notifications or Hudson Tray Tracker to help increase the visibility, but I wanted something physical that could radiate the current build status.  Something everyone could see; even while you’re grabbing a cup of coffee.  So, I decided to try and make a traffic light build indicator.

Traffic Light

Continue Reading

Comments are not the Goal

I used to think that writing more comments increased the readability of my code, but I’ve come to realize that comments frequently hurt readability. That might sound a little trollish, but here’s why I think it’s true:

  • Comments allow you to stop refactoring prematurely.
  • Comments aren’t kept up to date.  It’s really easy for this to happen because the association between a comment and the related code is very weak.
  • Comments that explain what code is doing are a DRY violation.  Your code should do that.
  • Frivolous commenting devalues your meaningful comments.  Your reader’s attention is a scarce resource – don’t waste it!

So, in my mind, the question really becomes “What is the best way to make this code easier to understand?” Continue Reading

Setting up Jenkins CI on an Amazon EC2 Linux Instance

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. In this post I’m going to document my steps creating an EC2 instance and setting up a Jenkins CI server on it. I’ll assume limited familiarity with Amazon EC2, Linux, and Jenkins. Continue Reading

FireIFrame – Extending Firebug to Simplify Working with Frames

The Trouble with IFrames and Firebug

I’m a huge fan of Firebug.  I tend to write most of my UI-centric Javascript right in the Firebug console so that I can run it and immediately see the results.  After I’m satisfied with the code I’ve written I’ll cut it out of Firebug’s console and paste it into its permanent home.  This probably isn’t the most efficient workflow, but it works well for me because it provides really fast feedback. Continue Reading

Baby’s First Foods

I’ve been playing around with Windows Phone development quite a bit lately.  I’m currently getting ready to submit my first application to the marketplace – “Baby’s First Foods”.

Babies under 1 year old can only eat certain foods depending on their age.  Each month new foods become available to the child.  It’s hard to keep track of what foods your child is ready for and what foods should be avoided. That’s the problem my app is trying to address.
Continue Reading