Heres my solution, it includes filters, but the values seem to be a bit erratic. The first value returns seems to translate to magnetic north (regardless of pitch and roll) I havent checked it, because I'm going to use this for a game, so I'm not concerned with the true value. You will need the attached library for thie example to work. Any other (less eratic) solutions would be greatly appreciated.
(excuse the name of the library, its really not that advanced)