Here's a nifty project I found off of Hackaday - how to build your own 16 point (4bit) digital compass. Instead of using the popular 3bit Dinsmore compass the author decided to build his own. The author attached a magnet to a reflective encoding disk. Using four infrared photoreflectors he was able to read the position of the disk and thefore the magnet. For those that aren't so clever as to create your own electric compass, the popular Devantech compass works.