Hi! I'm John...

Thinkhole Labs I'm an engineer, but sometimes I like to pretend I'm a programmer. Current obsessions include Ruby and Project Euler.

22 January 2010 | 0 Comments

New toys from Adafruit!

XBee kits and Motor Shield

The kits I ordered from Adafruit arrived! Here’s the list:

The XBee module that Adafruit sells is the chip antenna version. According to Parallax, “The wire antenna versions will provide 20-30% more distance than the chip antenna in the same environment.” Still, I should be able to get at least 300 feet out of it.

21 January 2010 | 0 Comments

Github account and repos

Well, it’s long overdue, but I’m finally using some form of VCS for maintaining the code that I write at home.

Up until a few weeks ago I was basically keeping a ‘Code’ directory in Dropbox and that was about it. Now I’m using git on each computer (i.e. notebook, desktop, etc.) and made a Github account (github.com/thinkhole).

Right now I have two public repositories:

The Arduino library has a decent amount of documentation, and should be quite usable. The Euler solutions are well… hey, they work. :)

19 January 2010 | 0 Comments

IR distance sensor and Arduino

GP2D12

Playing with the Arduino a bit again tonight. Here’s a snippet (source) to read the analog output from a Sharp GP2D12 analog distance sensor and convert it to centimeters:

Seems to work reasonably well.

01 December 2009 | 0 Comments

Gosu with Chipmunk physics

Gosu is a super-easy 2D game development library with a handy Ruby interface. Chipmunk is a fast 2D physics library, that plays nicely with Gosu.

Mix them together and what do you get? Me having a great time making little blocks fall from the sky:

The Chipmunk Ruby documentation is a bit lacking, but it follows the C interface closely enough that I’ve been able to pick it up without a problem so far.

01 December 2009 | 0 Comments

Animated Collatz sequence using Gosu

Continuing my obsession with the Collatz conjecture, I took some of my Ruby code from the other day and mixed in some Gosu 2D animations.

Basically, I randomly seed a bunch of objects and then let them bounce their way through the sequence until they bottom out at 1, and then drop them. There’s a counter in the top left that shows how many are left.

Anyway, here’s the video with the obligatory iMovie stock music in the background:

The little monster blocks are a free icon set from Fast Icon. I’m a huge fan. :)