Need Help with compass

Hi there,
Im radioamateur and Im seeking for solution how to see, in wich direction my antenna in roof is turned.
I bought Arduino Mega 2560, magnetic sensor (3 axes) and Oled display.
My idea is to put magnetic sensor on antenna mast (wich is turning by rotator) and connect it to arduino wich is also connected with display.
I would like to see on that display (or maby somewhere else) direction where antenna is turned.
I bought that eqipment and I was hoping Ill programe it somehow, but, For person wich met first time with C++, thats too much :wink:

I have been playing with Arduino DI/DO and it was simple, but, deeper I go, harder it is and now Ill quit with that and Ill ask for help here.
Is there anyone who have alredy writen code for that?
Hope for help...
Saso

Tell us what you have.

Which sensor ? which module ? where did you buy it ? how is it connected ?
Which OLED display ? which library do you want to use ? how is it connected ?

The Arduino Mega 2560 board has a 5V I2C bus, you can not connect 3.3V devices to that. Some modules use SPI, other modules have voltage level converters included. There are a lot of weird OLED displays out there. So you see... we first need to know what you have.

If you keep the magnetometer horizontal, it is simple. If you don't keep it horizontal you need an accelerometer and some extra calculations.