Magnetic rotation sensor code, help??

You may start posting what you have already, and describe where you get stuck.

Also a link to the data sheet of your specific sensor; a quick Google search on that type told me this are 10-bit resolution absolute rotary encoders. You say you have a 12-bit version.