Playing around

Just checked: my previous blog post was published in March 2013! Nearly two years ago.

It's been a crazy couple of years!

It's been a period that probably have the potential for some blog posts in the spirit of Marcus Hammarberg (a big inspiration, and well worth reading.) But, it also mean I've gotten to do less coding at work, and definitely less fun and exciting coding.

The solution?

A fun and exciting side project of course!

Work and play are words used to describe the same thing under differing conditions.

-Mark Twain

I've always loved playing with Lego, in particular Lego Technic. And this christmas yielded the Volvo wheel loader. This set features a remote controlled model of an actual Volvo Wheel loader:

The interresting part here is the remote control part. This model is remote contolled by an Infrared (IR) remote control, like TV remotes. Lately some mobile phones, like my Samsung Galaxy S4, are including IR blasters that can be used for remote controlling stuff. Usually stuff is your TV, and the app a less good version of a Logitech Harmony remote control.
Being a typical tinkerer, I wanted to see if I could control my Lego set with my phone. I found only the Samsung S4 Lego Speed Remote. Alas, this app only works for model S4 with Android version lower than 4.4 (Kit Kat).

The next obvious step was: Lets build one myself. Ignoring the fact that I've never built a working Andorid app before, this seemed like a perfectly good idea. (Particularly now that you no longer need to deal with eclipse to do Android development).

To realise this project I needed two things:

  1. Documentation of how the IR protocol works.
  2. Some way of accessing the IR blaster on my device.

Lego, being awesome in general of course have created a PDF describing the IR protocol in detail available from the IR receiver product page.
Second, with Andorid 4.4 (Kit Kat) the consumer ir manager API was added, making available an easy way of using IR blasters, regardless of vendor.

The result can be seen at my Github account. Code is still a bit rough and the UI is hideous. But it is working! (At least on 4.4.2, there seems to be breaking changes in 4.4.3)

This is the first blog post in almost two years. If the motivation stays I might even post another one within reasonable time..