Interfacing with a compass

Is it possible to interface the HMC5883L with the Arduino Mega?

Is it possible to get the offset with respect to North or any other direction from the Compass?

I want to control the degree of turn using the compass.

Is this possible? Do I have to download any library especially for this?

My chassis is made of metal and so are the motor shafts. Will this cause interference with the compass' reading?

Is it possible to interface the HMC5883L with the Arduino Mega?

Yes

Is it possible to get the offset with respect to North or any other direction from the Compass?

Yes

I want to control the degree of turn using the compass.

Is this possible?

Degree of turn of what an Oil Tanker?

Do I have to download any library especially for this?

You never have to down load a library to do anything. You can do everything in code.

My chassis is made of metal and so are the motor shafts

Is this ferrous metal?

Will this cause interference with the compass' reading?

Yes it could do with ferrous metal.

Yes it is ferrous. So will I get wrong readings? Or will all the readings be wrong by the same degree?
Thanks.

All the readings will be wrong by the same degree. It's relatively easy to correct for this.

But you have motors. Motors work by magnetism. Driving a motor forwards might disturb the compass in a different way to backwards. This kind of offset is very difficult to correct for. If you can sample the compass only when stationary, then it might be simpler.

Thank you so much.

I actually thought of using the compass to turn 90 degrees.

That is, keep turning the motors till the compass reading has increased/decreased by 90 degrees.

Thanks once again for your reply!