Two weeks ago I attended Stockholm Robot Championship at Tekniska Muséet. I participated with two robots; my minisumo Perfected Titan and a linefollower named squarewave which I didn't get to work properly in time. The results weren't that bad... Perfected Titan finished on 8th place out of 16 participants but he has played out his role now. He's been at two competitions so far and have only finished sort of half both times, it's time for a new build. The results from the competitions are here if anyone is interested. I filmed the minisumo-deathmatch of the competition, so here it is;

I develop using Vim as my IDE, it's very handy, but it has taken me a while to get there. I've recently spent time cleaning my vim plugins, now everything is fetched via Vundle.
Anyway, let's get on with it.
Two very crucial plugins for developing any C or C++, not just AVR-C, is YouCompleteMe and Ultisnips.
Both these plugins work very well together with a bit of configuring:

" Ycm vs ultisnips
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_select_previous_compltetion=[]

let &path = "/usr/avr/include,/usr/include,./"

au BufEnter * exec "inoremap <silent> " . g:UltiSnipsJumpBackwardTrigger . " <C-R>=g:UltiSnips_Reverse()<cr>"

let g:UltiSnipsJumpBackwardTrigger="<s-tab>"

The important part here being let &path = "/usr/avr/include,/usr/include,./". It adds /usr/include and /usr/avr/include to YCMs path where it looks for things to complete with.

When you're developing microcontroller code you very often have the datasheet for the microcontroller in question open at the same time, because let's face it; no one remembers all those registers in their head :).
For this I use Open-Pdf and a simple mapping that saves me a few keystrokes. I save all the datasheets of the processors/components that I work with in ~/Documents/Datasheets which is then linked to my ownCloud-folder so that I can have the same set of Datasheets on all my devices. The mapping is nothing more than a timesaver: map <Leader>d :Pdf ~/Documents/Datasheets/. It certainly doesn't look perfect, but it's quite handy to be able to search for registers and the like from within vim directly.

I'd thought I'd share a list of the tools that I use in my day to day business.

  • Sipcalc is an IP-address/network mask calculator, I should probably know this by hand, but sometimes it's hard to remember if a /28-mask is a 248 or 252 netmask.
  • Tmux is the best terminal multiplexer I have ever used, I spend most of my working day in either tmux or my browser
  • Curl is a library and command-line client for transferring data over a number of protocols, I mostly use it for testing JSON-responses though.
  • Vim shouldn't need an introduction.
  • Midnight Commander is a norton commander like filemanager with a two pane view, it's got both FTP and SSH-support, great for moving files without a coherent naming pattern back and forth.
  • MPD/NCMPCPP is what I use to listen to music with. I stream MPDs audio via a websocket from my home server to my job so I've got access to all my music all the time.

A few weeks ago my local LUG(which I've been a member of since the start) organized a so called "mini hackaton". We try to do this every three months or so, they're very popular. There's something special with getting together with other nerds and working on projects, be it software or hardware, for a day and chat.

I worked on this: Timerbox a small board with a relay, two buttons, a rotary encoder and an LCD that I've designed. The µCU is an Attiny 4313. I managed to get the LCD working quite well with a library written by user alan2k on This library is based on the library by Peter Fleury modified by Martin Thomas and Andreas Heinzen. It removes most of the "unnecessary" functions like scrolling but adds a very crucial setting for my PCB; disabling/enabling the RW-line. My PCB has the RW-line tied to be write-only, since I very rarely will care if the display says it's done or not, I'll handle it with delays instead.

I did however miss some things on the board, as you always do with 0.1-versions. As you can see the relay is "on stilts", that's because I forgot to change pad size when I did the footprint. I also tied the relays coil pin to +5V instead of +12V for some reason, I don't know what I was thinking there. But it's just version 0.1, 0.2 will be a lot better :)

Today I've been coding a bit on my KSP Control Center project. It's so far just 11 buttons, three SPI-controlled LED-displays and an analouge gauge, but it's getting closer to something more "real" every day.

It's for playing Kerbal Space Program, one of my favourite games. Heres a video of me showing of some of the new displays.

The three position switch in the video is for going between surface, target and orbital velocity. The code's on my github for anyone interested.